Catalogued procedures may be used to minimize the amount of JCL you need to submit in order to perform a number of possible tasks with respect to a HAL/S program. These tasks include compilation and link-editing. The rest of this section will assume that a regular complement of these catalogued procedures is available at your installation. Prototype versions of these procedures are listed in Appendix A. Table 2-1 gives the names of the procedures and their functions. The naming conventions for these procedures should be clear: each name begins with HALF (for HAL/S-FC) and has the letter C, or L, appended to it to refer to compilation or link-editing, respectively.
Table 2-1 Catalogued Procedures Available for Processing HAL/S Programs 2.5.2 How to Use the Catalogued Procedures
Only the simplest and most direct uses of the catalogued procedures will be described here. More complex situations, e.g., if more than one compilation unit is involved, will be discussed below in Chapter 3.
Any job, including one involving a catalogued procedure, must begin with a JOB card. This must be user-supplied, and must provide the usual information needed by your installation. A typical JOB card might be:
//TPS1840 JOB 7477,SLOTHROP.T,REGION=64K,TIME=(1,30), // PRTY=0,NOTIFY=TPS1840
But the requirements and even syntax of the JOB card may differ from installation to installation.
The procedure itself is called on an EXEC card which should have the following form: //ANYNAME EXEC <name of procedure>
ANYNAME may in fact be replaced by any name whatsoever, and may even be omitted, as long as at least one blank is placed between the ‘//’ and the EXEC operator. <name of procedure> is simply the name of the procedure being called.
It is possible (but not necessary) to pass a series of options to the compiler. A discussion and complete list of compiler options will be found in Section 5.1. These may be passed by coding on the EXEC card, immediately after the name of the procedure, a comma and then OPTION=‘<compiler options>’. The list of options must be enclosed in
apostrophes, and each one must be separated from the next by a comma. If no options are coded, defaults are specified in MONITOR’s option processor which are sufficient for most users.
The following JCL card, for example, calls for the compiling and link editing of a program HALFC Compiles a HAL/S program.
HAL/S-FC User’s Manual USA003090 32.0/17.0
2-22 November 2005
with the LISTING2 compiler option on and the SYMBOLS option set to 300. //COMPLINK EXEC HALFCL,OPTION=‘LISTING2,SYMBOLS=300’
2.5.2.1 To Compile
Simply to run a compilation, the HALFC procedure should be called. The EXEC card will be:
//COMPILE EXEC HALFC
with any desired compiler options specified with OPTION=. This should be followed by a DD card describing to the system the location of the source program you wish compiled. The ddname associated with this by the cataloged procedures is HAL.SYSIN. The source program may be included within the user’s JCL itself, in which case the format would be: //HAL.SYSIN DD * . . . source program . . . /*
Or else the program may reside in some catalogued dataset, in which case the format would be:
//HAL.SYSIN DD DSN=<dataset name>,DISP=(OLD,KEEP)
The primary output of the HALFC procedure is an object module, placed in a temporary dataset named &&HALOBJ. Note that since this dataset is defined by the procedure as temporary, it will be deleted at the end of your job. If you wish to store it for later use, modification of the JCL procedure will be required (see Section 2.4.4.3).
2.5.2.2 To Compile and Link Edit
To compile and link edit a HAL/S program in order to produce an executable load module, the HALFCL procedure should be called. The EXEC card will be:
//COMPLINK EXEC HALFCL
(with any desired compiler options specified with OPTION=).
This should be followed by a DD card describing to the system the location of the source program you wish compiled and linked. The format of this card is precisely the same as the HAL.SYSIN DD card described above in Section 2.5.2.1.
The primary output from the HALFCL procedure is an executable load module, placed in a temporary partitioned dataset named &&LOADMOD in a member called GO. Note that since this dataset is defined by the procedure as temporary, it will be deleted at the end of your job. If you wish to save it for further use, an additional DD card modifying the procedure will be required (see Section 2.4.4.3).
2.5.3 Standard DDnames and Outputs Associated with the Catalogued Procedures
Complete listings of the various catalogued procedures available may be found in Appendix A, along with a detailed description of their workings. The following table lists the standard ddnames and outputs associated with each of the processes called by the procedures. Users unfamiliar with the HAL/S compiler and link editing systems should ignore (or at least postpone reading) this section.
Compilation (Step HAL of Procedures HALFC and HALFCL) Program: MONITOR
User Options: OPTION
DD names
STEPLIB Defines a load module library where MONITOR is found. SYSIN The HAL/S program to be compiled.
PROGRAM A dataset defining the compiler to be used.
SYSPRINT A formatted listing of the source program, which is directed to the line printer.
LISTING2 An unformatted listing of the source program (optional), directed to the line printer.
OUTPUT3 The object module produced by the compilation, which is kept in a temporary dataset named &&HALOBJ for passage to the link editor.
OUTPUT4 A second copy of the object module directed to the card punch (optional).
HAL/S-FC User’s Manual USA003090 32.0/17.0
2-24 November 2005
Link Editing (Step LKED of Procedure HALFCL) Program: LINK101 User Options: none DD names
OUTPUT5 The Simulation Data File produced by Phase 3, which is kept in a temporary dataset called &&HALSDF for passage to later compile steps.
OUTPUT6 The template library produced by the compiler, which is kept in a temporary dataset named &&TEMPLIB for passage to later compile steps.
ERROR The error library required by the compiler. FILE1-FILE6 Temporary work files.
SYSLIN The object module to be link edited.
SYSPRINT The diagnostic output dataset, directed to the line printer. SYSLIB The HAL/S runtime library of built-in functions and procedures. SYSLMOD The load module produced by the link editor, which is kept as a
member of a temporary dataset called &&LOADMOD for passage to an execution step.