Prev Up Next
Go backward to 4.13 VAX Logical Names
Go up to 4 Labs
Go forward to 4.15 VAX Variables -- #2

4.14 VAX Variables #1

It is often desirable to have general procedures. Ones that can be used for more than one narrow purpose. We have seen that this can be done with logical names in the VAX/VMS environment. A better way in many cases is to pass names to the procedures. In much the same way you have passed names and arguments to the text editor and compilers. To do this systems assign special names to passed arguments in command procedures. In VAX/VMS the names are P1, P2, and P3 for the first second and third arguments passed. In MS-DOS batch files they are %1, %2, and %3. UNIX systems would use the names $1, $2, and $3.

In this I would like you to write a general purpose command procedure to compile, link, and run a FORTRAN program.

  1. Using FORTRAN lab as a guide, create a general purpose command file for, compiling, linking and running FORTRAN programs. In a file named DOFOR.COM, put all the commands, with dollar signs ($), except whenever you find CIRCLE, replace it with 'P1' (single quotes included). For example, the first line would be
     
    $ FORTRAN 'P1' 
    
    Also add a comment ($!) line at the top with your name and the date.
  2. Test it and make sure it works. Set verify on, then
    $ @DOFOR CIRCLE 
    
    Everywhere you had 'P1' you should see CIRCLE, and it should compile and execute. Don't forget to set noverify when you're finished.
  3. Submit it as a batch job with parameters.
     
    $ SUBMIT DOFOR.COM /PARAMETER=(CIRCLE)
    
Turn in a copy of the .LOG file marked with:
Your-Name
Lab 4.14: VAX Variables #1 - FORTRAN - DOFOR.COM
TABER CSC135
Place the lab in the instructor hand-in box in BUS R6E, the "terminal room".
Instructor: ltaber@pima.edu** Red's Home page** The Pima College Site

Prev Up Next