Introduction
Applications
FORTRAN Utilization on MVS (Batch Mode)
Example Programs
Related Documentation
This documentation provides instructions for running FORTRAN jobs at the University of South Carolina. Included are instructions for running the various compilers in batch mode (on MVS). For the user who needs more than a general introduction to FORTRAN, sources of additional documentation are listed at the end. This documentation was produced by the Academic Research and Data Center of USC. Questions about its content should be referred to a FORTRAN consultant at 777-6865.
The acronym FORTRAN is made up of the initial letters of the words FORmula TRANslation and, as the words imply, FORTRAN is particularly useful in scientific, engineering, and mathematical applications requiring numerical computation. FORTRAN was one of the first high-level programming languages and, consequently, is widely available today.
The FORTRAN compilers available at the University of South Carolina:
IBM VS FORTRAN, Version 2.6.0 in batch mode
The remainder of this documentation describes the available FORTRAN processors under MVS and CMS.
IBM VS FORTRAN
NOTE: The default language level for release 2.6.0 of VS FORTRAN is 77. The symbolic parameter LANGLVL is no longer included in the cataloged procedures. You must remove 'LANGLVL=77' or 'LANGLVL=66' from any EXEC statements that invoke the IBM VS FORTRAN. However, LANVLVL(66) is still available if required.
The JCL for running a program using VS FORTRAN 2.6.0 follows:
Compile Only:
JOB statement
// EXEC FORTVC
//FORT.SYSIN DD *
FORTRAN source program
Compile and Link Edit:
JOB statement
// EXEC FORTVCL
//FORT.SYSIN DD *
FORTRAN object program
//GO.SYSIN DD *
Data (if any)
//
Compile and Execute:
JOB statement
// EXEC FORTVCG
//FORT.SYSIN DD *
FORTRAN source program
//GO.SYSIN DD *
Data (if any)
//
Compile, Link Edit, and Execute:
JOB statement
// EXEC FORTVCLG
//FORT.SYSIN DD *
FORTRAN source program
//GO.SYSIN DD *
Data (if any)
//
JOB statement
// EXEC FORTVG
//STEPLIB DD
// DD DSN=userid.prog.lib,DISP=SHR
//GO.SYSIN DD *
FORTRAN unit 5 input here (if any)
/*
Other DD statements for units other than 5, 6, & 7 here.
//
The default region for the GO step in FORTVCLG, FORTVCG, and FORTVG cataloged procedures
is 1M (1024K) bytes. To request more region for the execution (GO) step, code the
symbolic parameter GOREGN on the EXEC statement that invokes FORTVCLG, FORTVCG, or FORTVG.
Example: // EXEC FORTVCLG,GOREGN=4096KThe stepnames are the same in all of the VS$FORTRAN cataloged procedures.
Stepname Step Function
-------- -------------
FORT Compilation step
LKED Linkage editor step
GO Execution step
To link a subroutine library at the LKED step in FORTVCLG, use the following JCL (same for
LKED-step in FORTCL as well):
JOB statement
// EXEC FORTVCLG
//FORT.SYSIN DD *
FORTRAN source program
//LKED.SYSLIB DD
// DD DSN=subroutine.lib.dsn,DISP=SHR
//GO.SYSIN DD *
Data (if any)
//
Any main program compiled by the current VS FORTRAN compiler (release 2.6.0) that calls
subroutines compiled by other FORTRAN compilers (e.g., G, G1, or H ext.) or versions of
VS FORTRAN before release 1.2.0 may have execution problems due to the current MVS/ESA
operating system.
For FORTVCLG:
// EXEC FORTVCLG,PARM.LKED='LET,LIST,XREF,AMODE=24'
For FORTVCG:
// EXEC FORTVCG,PARM.GO='LET,NORES,EP=MAIN,AMODE=24'
An alternate approach for FORTVCLG is to add the following DD statement and data cards to
the linkage edit step:
//LKED.SYSIN DD *
MODE AMODE(24)
The following example illustrates how a FORTRAN program might be set up using the VS FORTRAN compiler under MVS (batch mode). The simple program in this example computes gross pay, given hours worked and rate of pay. Input to the program is included in the job stream (following the //GO.SYSIN DD *).
JOB statement
//STEP1 EXEC FORTVCLG
//FORT.SYSIN DD *
C
C PAYROLL PROGRAM
C
WRITE(6,101)
101 FORMAT(1H1,10X,'HOURS WORKED',10X,'PAY RATE',10X,
* 'GROSS PAY',/)
1 READ(5,102,END=99) HRS, RATE
102 FORMAT(F3.1,F4.3)
GROSS= HRS * RATE
OVER= HRS - 40.0
IF(OVER.GT.0.0) GROSS= GROSS + (.5*OVER*RATE)
WRITE(6,103) HRS, RATE, GROSS
103 FORMAT(14X,F4.1,16X,F5.3,13X,'$',F6.2)
GO TO 1
99 STOP
END
//GO.SYSIN DD *
4003100
3753100
4005000
4508000
2503750
//
Following is the output produced by this program:
HOURS WORKED PAY RATE GROSS PAY
40.0 3.100 $124.00
37.5 3.100 $116.25
40.0 5.000 $200.00
45.0 8.000 $380.00
25.0 3.750 $ 93.75
As mentioned above, this documentation provides only the most general information on FORTRAN. Following are more detailed FORTRAN references.
IBM Manuals
Detailed information can be obtained from the following IBM manuals, available for use in the CS Reference Room (third floor, CS Building, 1244 Blossom Street) and for purchase from IBM.
VS FORTRAN Version 2 Language and Library Reference (SC26-4221)
VS FORTRAN Version 2 Programming Guide (SC26-4222)
VS FORTRAN Version 2 Reference Summary - Pocket Guide (SX26-3751)
VS FORTRAN Version 2 General Information (GC26-4219)
Other Documentation
In addition to these manuals, documentation on various topics related to computer use at USC are available at ARDC Documentation, and at ARS Handouts, and the CS Reference Room. The following is documentation that is relevant to material presented in this discussion:
JCL -- documents JOB Control Language used in running batch jobs.
SUBMIT -- documents general procedures for submitting batch jobs
from VM/CMS.