Information for VMS operating system


Important handouts for VMS

Get a copy of the EDT_USER.TXT and INTRO_USER.TXT. If none are available, you can have one printed by sending the appropriate file to the printer:

	PR/QUE=IPC414 SYS$SERDAC:[GUIDE]filename.ext

Also, the following tutorials are helpful to run, they give you short cuts for editing and using VMS:

RUN EDT2CAI
Learn the short-cuts to editing
RUN VMS2CAI
Learn to delete files, copy files, create directories

Back to Index


Mail utility on VMS

To use the e-mail facility on the VAX, just type MAIL at the $ prompt. You will then see the

    MAIL>

prompt.

You can type HELP to get a list of commands.

Type MAIL to send a message. My user ID is DOWNEYT

Hit ENTER to read any messages that you have. Type D to delete the message you just read.

Back to Index


Special directories on VMS

There are several special directories on SERVMS and SERVAX that you should set up in your file. To set them up use the following format in your LOGIN.COM file.

	$ DEFINE   CBIN    SYS$SERDAC:[DOWNEYT.CLASSBIN]

Do the above for each of the shorthands you wish to create and use.

CBIN
SYS$SERDAC:[DOWNEYT.CLASSBIN] contains several binaries and command files that can make your life easier when using VMS
CTESTS
SYS$SERDAC:[DOWNEYT.TESTS] contains copies of old midterm exams
C2210
SYS$SERDAC:[DOWNEYT.C2210] contains assignments for Pascal classes
C3212
SYS$SERDAC:[DOWNEYT.C3212] contains assignments for Ada classes
C3400
SYS$SERDAC:[DOWNEYT.C3400] contains assignments for Assembler classes
C3423
SYS$SERDAC:[DOWNEYT.C3423] contains assignments for C classes
Back to Index

Creating a directory for program files

I like to keep all my program files in their own directories, so I have created several directories for the different languages I program in: PASCAL, ADA, C, COBOL, MACRO. Here is an example for creating a directory called MACRO, but just change the name to create a directory with any name.

	CREATE/DIR [DLETTE06.MACRO]

You should replace DLETTE06 with your userid. Then when you want to work in MACRO, switch to the MACRO dir by issuing the command

	SET DEF [DLETTE06.MACRO]

To avoid typing this all the time, add the following to your LOGIN.COM file (be sure to include the $ sign):

	$ MDIR == "SET DEF [DLETTE06.MACRO]"
	$ ROOT == "SET DEF [DLETTE06]"

This way, you can easily switch to the MACRO directory by typing MDIR at the $ prompt. Switch back to your login directory by typing ROOT.

Or use the CD command that is in the CBIN directory.

	CD \MACRO
	CD \

Back to Index


CREATING LOGIN.COM

The LOGIN.COM file is a special file, any commands in this file will be executed every time you log on the to SERVAX or SERVMS, so you don't have to enter the commands by hand.

To create (or edit) a file called LOGIN.COM issue the following commands

	SET TERM/LINE/INQ
	EDIT   LOGIN.COM

When you see the * type the letter C and hit the ENTER key.

Enter the following EXACTLY!!! (be sure to include the $ sign):

	$ SET  TERM/INQ/LINE/FORM
	$ DEFINE  CTEST  SYS$SERDAC:[DOWNEYT.TESTS]
	$ DEFINE  CBIN   SYS$SERDAC:[DOWNEYT.CLASSBIN]

Then include one or more of the following pairs of lines, depending on which class or classes you are taking

	$ DEFINE  C3400  SYS$SERDAC:[DOWNEYT.C2212]
	$ @CBIN:COMP_C2210

	$ DEFINE  C3400  SYS$SERDAC:[DOWNEYT.C3212]
	$ @CBIN:COMP_C3212

	$ DEFINE  C3400  SYS$SERDAC:[DOWNEYT.C3400]
	$ @CBIN:COMP_C3400

	$ DEFINE  C3400  SYS$SERDAC:[DOWNEYT.C3423]
	$ @CBIN:COMP_C3423

Then press Ctrl-Z to leave full screen mode and return you to the *, then type EXIT

The first command lets you edit files in full screen mode as opposed to line mode. The next three commands create shorthands for some of my special directories. The last command runs a program that will report all new files in the selected directory since your last login.

Issue the command

	@LOGIN

this will invoke the file you just created. You are doing this now, because LOGIN.COM didn't exist when you logged on to the VAX. In the future, you won't have to issue this command. LOGIN.COM will be executed automatically when you log in.

See what is in a directory by typing
DIR CBIN:
See what is in a file by typing
TYPE CBIN:FILENAME.EXT
Copy a file into your directory by typing (the [ ] are VERY important)
COPY CBIN:FILENAME.EXT [ ]
Printing a file from the directory
PRINT/QUE=IPC414 CBIN:FILENAME.EXT

You can use any of the directory shorthands in the above commands
Back to Index


USER command

I have added a comand procdure to the CBIN directory that will show you all processes for your user ID. This is useful in case you have a session active on another terminal and want to kill it.

The command is @CBIN:USER

To stop a process, just type

	STOP Process-name

where Process-name is the name of the process you want to stop.
Back to Index


CD command for VMS

I have added a COM file to the CBIN directory that will change your prompt to the current path. For those who use several directories, this can be quite useful.

	
	CD  DIR_NAME

where DIR_NAME is the name of a subdirectory in the current directory, or the complete path name of a directory from your root directory. For example,

	CD  MAR

will change to the subdirectory [.MAR] and

	CD  DOWNEYT.MAR

will change to the directory from any directory. Do not include the [] in the command.

If you want to change to a subdirectory of the LOGIN directory, when you are not in the LOGIN directory, then put \ before the path name:

	CD \MAR

will change to the MAR directory.

CD with no parameters will return you to the LOGIN directory.

It will even work on nested subdirectories:

	CD SUBDIR.SUBSUBDIR.SUBSUBSUBDIR

It should work on logicals like C3212:

	CD C3212

Put the following lines in your LOGIN.COM file

	CD=="@CBIN:CD"
	CD

Be sure this is after FISHNET (if you have it).

Back to Index


VMS Debug command

I have created a COM file that will copy an initialization file to your login directory and will also modify your LOGIN.COM file. It is a simple intialization file, you can modify it once it is in your login directory. A copy of your original login.com will be saved in LOGIN.DBG_BAK. To install the initialization file, issue the command

	@A HREF="#SPECIAL_DIR">CBIN:install_debug
  1. The debugger can be a very useful tool. To use it, be sure all your source files are compiled (or assembled) with the /DEBUG option. Also, be sure that the link command includes the /DEBUG option. This keeps all the symbolic names (variable names, procedure names) visible for the debugger. If using the ADA or PASCAL compilers, also include the /NOOPT option when compiling. You can also use the DB command file in A HREF="#SPECIAL_DIR">CBIN.

  2. When you RUN the program, you will automatically start up in debug mode. The default mode in the debugger is NOSCREEN. But the SCREEN mode is very nice. To change to SCREEN mode enter
    	SET MODE SCREEN
    

    if you want to return to NOSCREEN, just type

    	SET MODE NOSCREEN
    

    Once in SCREEN mode you can scroll the different sections of the screen using the scroll keys on the numeric keypad (8 is up, 2 is down).

  3. GO will execute your program up to the next BREAK. If there aren't any BREAKs, then it will run to completion.

  4. STEP will execute you code one instruction at a time. The SET STEP N command can change the default step to N.

    STEP/INTO will step into the subroutine that is about to be executed.

    STEP/OVER will execute the subroutine, but not line by line.

    The default for stepping is STEP/OVER.

  5. SET BREAK NAME will put a break point at the symbolic name NAME. For instance, the name of a subroutine. When you type GO, the program will stop if this BREAK point is reached.

    SET BREAK/LINE will put a break point on each line.

    SET BREAK/CALL will put a break point at every call to a subroutine.

    SET BREAK %LINE N will put a break point at line N.

    CANCEL BREAK NAME will delete the break point.

    CANCEL BREAK/LINE will stop breaking on every line.

    CANCEL BREAK/CALL will stop breaking on every call.

    CANCEL BREAK %LINE N will delete break at line N.

  6. SET WATCH VARIABLE allows you to see when a variable changes. Whenever VARIABLE changes, the debugger will stop at that line of code.

    CANCEL WATCH VARIABLE will cancel the watch

  7. DEPOSIT VARIABLE = VALUE allows you to put a value into a variable.

  8. SHOW MODULE displays the modules in your program. If you try to reference a name, but the debugger doesn't know where it is, you can use the command SET MODULE NAME. Then, when you don't need the module anymore, you can CANCEL MODULE NAME. Also SET MODULE/ALL will make all the names in your complete program available.

  9. SHOW CALLS will display all currently active routine calls.

  10. SHOW STACK will give more information about caurrently active routine calls.

Back to Index


STREAMLINING THE EDT EDITOR

If you want to streamline the EDT editor, you can create a file called EDTINI.EDT containing the following:

	SET MODE CHANGE
	DEFINE KEY GOLD E AS "EXT EXIT."
	DEFINE KEY GOLD Q AS "EXT QUIT."
	DEFINE KEY GOLD I AS "EXT INCLUDE ?*' Include File: '."
	DEFINE KEY GOLD A AS "EXT FIND =ALT.."
	DEFINE KEY GOLD M AS "EXT FIND = MAIN.."
	DEFINE KEY GOLD S AS "EXT FIND = ?*' Switch to Buffer: '.."
	DEFINE KEY GOLD W AS "EXT WRITE ?*' Write file to: '."

Here is a description of what each line does. The GOLD key is the PF1 key on the VAX numeric keypad.

  1. Allows you to start EDT in full screen mode, instead of entering C at the * prompt.
  2. Allows you to press PF1-E to exit directly from EDT full screen mode to the $ prompt, instead of CTRL-Z to the *, and then EXIT to the $.
  3. Allows you to press PF1- Q to quit directly from EDT full screen mode to the $ prompt, instead of CTRL-Z to the *, and then QUIT to the $.
  4. Allows you to enter PF1- I to include a file once you are in full screen mode. After pressing PF1- I, you will be prompted for the name of the file to be included.
  5. Allows you to switch to an alternate buffer. This can be used to copy info from a previous program into a new program. PF1- A switches to the alternate buffer.
  6. Allows you to swith back to the main buffer from the alternate buffer. PF1- M switches to the main buffer.

The EDTINI.EDT file only works when the editor is called from the directory containing this file. To make the EDTINI.EDT file visible to all directories, include the following line in your LOGIN.COM file:

    $ ED*IT == "EDIT/EDT/COMMAND=SYS$STUDENT:[DLETTE06]EDTINI.EDT

where you must replace 12345678A with your USERID. Notice the * in ED*IT, this allows you to type either ED or EDIT to invoke the EDT editor.

Back to Index


Multiple buffers for EDT editor

It is possible to call up the .LIS file in an alternate buffer, with the program file in the main buffer (either a .PAS, .ADA, or .MAR file).

  1. Edit the program file (.PAS, .ADA, or .MAR)

  2. Switch to an alternate buffer. You must find the COMMAND key and press it (GOLD 7 on the VAX terminal keypad).

  3. Enter the command FIND=ALT and hit enter (the keypad ENTER).

  4. You are now in a buffer called ALT. Include the .LIS file here by hitting COMMAND again and entering INCLUDE FILENAME.LIS

  5. To return to the main buffer, where the program file is, do COMMAND followed by FIND=MAIN and enter.

  6. You can switch back and forth by using the COMMAND followed by either FIND=ALT or FIND=MAIN.

  7. You can save changes to either buffer by pressing CTRL-Z, then press W at the *, then C to return to full screen mode.

You can save a lot of keystrokes if you streamline the EDT editor. Then you can switch to the ALT buffer by hitting GOLD A and return to the main buffer by hitting GOLD M. You can include a file by hitting GOLD I followed by the name of the file to include.

When you exit the editor, only the changes to the main buffer are kept.

Back to Index


EVE editor

I have created a COM file that will install all these files in your login directory, and will modify your LOGIN.COM file. A backup of LOGIN.COM wil be in LOGIN.EVE_BAK.

When you log in, you will be asked if you want to run EVE. If you do, then EVE will be created in a new process. Once inside EVE, do not exit until you are ready to log off, then hit CTRL-Z. This will stop the subprocess and return you to your main process. However, use the PF1-A key to switch back to the main process at any time. Any files that you have opened will remain open. To return to the editor from your main process, just type the command ALT.

The EVE editor uses the same keys as the EDT editor, so there is very little extra to learn. EVE has a much better help system.

Below is a description of what my COM file does.


The EVE initialization file is called EVE$INIT.EVE and will be placed in your root directory. I have put a copy of the file I use into the A HREF="#SPECIAL_DIR">CBIN directory. Here is a brief discription of what my initialization file does.

Use CTRL-Z to exit EVE, or PF1-Q to quit. Use PF1-A to switch to your login process while keeping EVE active. Use ALT to switch from your login process back to the editor.

I create a spawned process when I log in. I never close the editor. It saves a lot of time. Just WRITE (PF1-W) the new changes to the disk, then ATTACH (PF1-A) to your login process and compile your program. If there are errors, then ATTACH (ALT) to the other process, you will be in the same place in the file that you left. You can open new files in new buffers and switch between them. You can split the screen and have two files on screen. It is very powerful. There is also a VERY GOOD on line help facility. Use PF2 to access it.

The GOLD-B key is nice, it shows you a list of buffers. Use the arrow keys to highlight the buffer you want, then use ENTER to make it active. You can also delete a buffer you don't want any more by hitting the CUT key (6 on EDT keypad).

This command will be placed at the start of your login file.

$ EV*E == "EDIT/TPU"

The following commands will be put at the end of your login file. If I want to create another process for the editor, I respond with Y, otherwise no process will be created. I can type ALT to switch to the EDIT SESSION from the login session. 'Userid' will be replaced with your USER_ID.

$ alt :== attach userid_eve
$ inquire YN SPAWN_ED_(Y/N)?
$ if (YN.eqs."Y") .or. (YN.eqs."y") then SPAWN /process=userid_eve EVE

Be sure that these statements are at the END of your LOGIN.COM file, just before the $ EXIT statement. Edit your login.com file and be sure there isn't a $ EXIT statement before these new statements.


The one drawback to EVE is the difficulty in changing the default directory. I wrote a procedure that will ask for the new directory and change to it. A copy of the file TPU$COMMAND.TPU will be copied to your directory.

With this, you can specify any VAX or VMS directory.

Back to Index


Page break in VMS editors

Be sure that no subroutines start on one page of the printout and end on another page. To do this, enter CTRL-L in your program wherever you want the printer to start a new page. You don't need to count lines to determine where the page breaks should be. The SECTION key (8 on the numeric keypad) advances 16 lines at a time. Be sure that you have a page break at least once avery 3 SECTIONS. Don't put a CTLR-L in the middle of a subroutine.

Back to Index


Compiling, linking and running a program for VMS

The steps are similar for running programs in all languages on a VMS operating system. First compile, then link, then run. The link and run commands always use .obj files, so they are identical for all languages. The only difference is the compiler. Each compiler makes an assumption about the extension of a source file.

Here is a listing of the language, the compiler, and the default extension:

C
Compiler: CC
Extension: .C
Pascal
Compiler: PAS
Extension: .PAS
Ada
Compiler: ADA
Extension: .ADA
Assembler
Compiler: MAC
Extension: .MAR
Cobol
Compiler: COB
Extension: .COB

To compile, link and run a program, use the following commands. The name of the file should be PROG1.ext, where ext is the appropriate extension from the above list. Do not include the extension in the commands below, but the file must have the correct extension in order for the commands to work. Replace Compiler with the appropriate abbreviation from the above list.

	Compiler/LIS/DEB PROG1
	LINK/DEB PROG1
	RUN PROG1

The /LIS is optional, it will create a file with a .LIS extension that lists your program, and all errors as a result of the compilation. This is a good file to look at when you have a program with a lot of errors.

The /DEB is also optional, but it will allow you to run the program using the debugger. This is very helpful for fixing programs. If you compile with the /DEB switch, and you get a FATAL ERROR when trying to run the program, you will need to use the command

	RUN/NODEBUG PROG1

in order to suppress the running of the debugger. If you just omit the /DEB switch from the compiler and link commands, then the debugger will not be invoked.

Back to Index


Command file for compiling and linking for VMS

You mean you are actually reading this when you don't need to??? Well, here's your reward: instead of typing the compiler, LINK, and RUN commands all the time, you can access a command file that I wrote and placed inthe CBIN directory. This will execute these commands for you. It may not seem like much now, but you will appreciate it when you have to test a program. To compile, link, and run a program in a file called FUN.ext (where ext is the correct extension for the desired compiler), issue the following command:

    	@CBIN:MK  Compiler  FUN

IMPORTANT: FOR THIS TO WORK, THE FILE MUST HAVE THE CORRECT EXTENSION.

If you would like to run the program several times, then include the number of runs you would like:

    	@CBIN:MK   Compiler  FUN  3

This will run the program 3 times.

To run the program under the debugger:

    	@CBIN:DB  Compiler  FUN

Back to Index


Creating a listing to be handed in for VMS

Use the following steps to create a listing of a run of your programs. Only issue these commands when your program is ENTIRELY DONE AND CORRECT!!! filename below must have the correct extension for the desired compiler, but do not include the extension in the following commands. In the LINK command, the cbin:mar_io_vax file is only needed when linking assembler programs.

	set term/width=132
	carbon/on 
	compiler/lis filename
	type filename.lis
	link filename,cbin:mar_io_vax
	run filename
	(make sure you give me some test runs!!!)
	carbon/off/wait
	set term/width=80

Then when you send the file to the printer, specify your last name and the program number:

	cprint/que=IPC414   audit.log   lastname.prg#

Other print queues are IPC415 and IAI293_2.

YOU MUST USE CPRINT FOR AUDIT.LOG
USING PRINT MAY HANG THE PRINTER

Back to Index


Command file for creating a listing to be handed in on VMS

A second bonus!! Another command file in CBIN. Instead of typing ALL THOSE COMMANDS for creating a listing to be handed in to me, you can issue the command:

    	@CBIN:HANDIN  Compiler  FUN  LAST_NAME.PROG_NAME

NOTE: HANDIN.COM only works on SERVAX

This assumes that the program is in a file called FUN.ext, where ext is the correct extension for the desired compiler. For the LAST_NAME.PROG_NAME use your last name and the name of the program. This will be on the banner of the printout, and will be the name of the file in your directory. Do not include any blanks within LAST_NAME.PROG_NAME.

If you want several runs, just include the number you want

    	@CBIN:HANDIN  Compiler FUN  LAST_NAME.PROG_NAME  3

This will create a listing with three separate runs.

Back to Index


You are visitor number [an error occurred while processing this directive] to visit this page since 10/4/96.