HiLMAs reference
Back Environment Instructions Next

PROGRAM

 

PROGRAM    program-name,operating-system

[,COMAREA=,SYSIN=,SYSOUT=,LSTACK=0,PSEUDO=NO]

 

Description

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:

SYSIN and SYSOUT are environment dependent parameters that can be used only in batch (MVS or DOS) programs:

 

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 specifications

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

 

ENDPROG

 

Description

 

ENDPROG must be the last executable HILMAS instruction.
Cannot be omitted and must always come before the definition of the variables.

 

Examples

 


Back Start Next
Alphabetic reference Top ENVIRON