PROGRAM program-name,operating-system
[,COMAREA=,SYSIN=,SYSOUT=,LSTACK=0,PSEUDO=NO]
The PROGRAM statement initiate the program. This statement is mandatory and every source (that isn't an external routine) can contain only one PROGRAM and one ENDPROG statement.Must be the first HILMAS instruction; program name is the name of the program (8 characters max.) and operating-system can be MVS, DOS (i.e. VSE), CICS, TSO or CMS.
LSTACK parameter is required only if you write a recursive program or subroutine and must be the length in bytes of the stack that will contain subroutine variables saved with SAVEVAR parameter (all environments).
COMAREA and PSEUDO are environment dependent parameters that can be used only by CICS programs:
COMAREA=varname can be used when you must pass a commarea greater then 130 bytes at the program: use COMAREA to specify a variable name that will be greater then 130 and will contain passed Commarea. If omitted, $PARAM Hilmas variable contain passed COMMAREA (truncated if longer than 130); if program don't has COMMAREA (i.e. is initiated by user with a transid) $PARAM contains program parameters eventually written by user near transid.- PSEUDO=YES must be used if you use only Hilmas fullscreen statement (BUILDMAP and CONVERSE) and you want that pseudo-conversational will be managed automatically and transparently by Hilmas. Default is NO.
SYSIN and SYSOUT are environment dependent parameters that can be used only in batch (MVS or DOS) programs:
SYSIN=NO can be used when you for some reason don't want automatically open standard input in batch (this file can be opened next as a normal sequential file); default is SYSIN=YES- SYSOUT=NO can be used when you for some reason don't want automatically open standard output in batch (this file can be opened next as a normal sequential file); default is SYSOUT=YES
Note that:
- If you don't write environment dependent instructions (for example EXEC CICS), the operating-system parameter is generally the only thing you must change to port the program to another environment, even from a batch to interactive or vice versa, if you use only line mode I/O instructions.
- You can pass parameter (that is some extra words) when call a HILMAS program:
these are get back in a HILMAS system variable called $PARAM. In a batch program parameters can be specified in PARM= (VSE and MVS) parameter, in PGM=programname JCL instruction. In CICS, $PARAM variable is automatically filled with input Commarea if the program is recalled by another program.
Parameter Name Mode Type coding Remark 1 program-name fixed name 2 operating-system fixed name Can be only CMS,TSO,CICS,MVS,DOS LSTACK=number Integer constant To support recursive subroutines COMAREA=var CICS only PSEUDO=NO/YES CICS only SYSIN=YES/NO Batch only SYSOUT=YES/NO Batch only
ENDPROG