

Subprograms › Requirements for Subprograms
Requirements for Subprograms
Any subprogram called by a CA Ideal program must follow certain conventions.
- You must define the subprogram to CA Ideal using the program definition identification fill-in. For CA Ideal subprograms, any parameters passed to the subprogram from the calling program must be defined on the program identification fill-in. For non-Ideal subprograms, any parameters passed to the subprogram from the calling program must be defined in the program identification fill-in and the subprograms linkage section. When defining the parameters, keep the following in mind:
- Include the descriptions of each data item expected from the calling program.
- Specify level-1 parameter definitions in the same order as the corresponding data items are specified in the CALL statement of the calling program. Each data item in the CALL statement is matched, in order, with a level-1 parameter in the called program.
- The passed data item and the corresponding level-1 parameter can have subordinate fields. However, the data types and structures of the passed data items must match that of the receiving data items.
- The names assigned to parameters in a subprogram need not be the same as the names of the data items referenced in the CALL statement.
- The calling program must include the subprogram as a resource on the program resource fill-in.
- Make a distinction between programs run online or in batch. A CA Ideal program run online can call a CA Ideal subprogram, a non-Ideal online subprogram or initiate an asynchronous run of a CA Ideal program. A CA Ideal program run in batch can CALL any CA Ideal subprogram that does not contain a TRANSMIT or a non-Ideal batch subprogram.
Beyond these facts, there are a number of significant differences between the requirements for the design and use of CA Ideal subprograms and of non-Ideal subprograms. For example, when the subprogram is coded in COBOL, PL/I, or Assembler, it is written and maintained outside of CA Ideal. When the subprogram executes, CA Ideal relinquishes control to the subprogram.
You should be careful that the non-Ideal subprogram does not modify the CA Ideal environment. When a CA Ideal subprogram executes, CA Ideal maintains control of the environment. Due to this major difference, the remainder of this section is divided into two parts: Calling CA Ideal Subprograms and Calling non-Ideal Subprograms.
Note: CA Ideal programs cannot be called as subprograms by programs written in other languages when executing in batch. Online, a CICS command level program can invoke a CA Ideal session by using the EXEC CICS START command to start a CA Ideal transparent sign-on. For more information about transparent sign-on, see the Administration Guide.
Copyright © 2015 CA Technologies.
All rights reserved.
 
|
|