Previous Topic: Identical Parameter MatchingNext Topic: Parameter Rules


Linkage Conventions for Non-Ideal Subprograms

Each time a non-Ideal subprogram is called online, CICS determines whether the program is reloaded. CICS requires all programs to be at least
quasi-reentrant. You can, however, specify that non-Ideal subprograms called in batch, which may be only reusable and not reentrant, remain in memory for the entire run or until they are explicitly released (by a RELEASE PROGRAM statement). The New Copy on Call specification is part of the program identification for non-Ideal subprograms.

If the Digits specification contains any decimal (fraction) places, CA Ideal aligns the numeric value according to the Digits specification, but you must design the non-Ideal subprogram to account for the implied position of the decimal point. For example, if the Digits specification is 3.2 and the value to pass is 123.45 in packed decimal format, the internal value is X'12345C'. You must design the non-Ideal subprogram to expect the implied decimal point to be between the third and fourth digits.

To be flexible with other language conventions, CA Ideal does not align binary operands in non-Ideal subprogram parameter definitions. For example, if the SYNC option is not used in COBOL, binary fields are not aligned. If CA Ideal always forced alignment, it might be impossible to pass a group data item that contained one or more binary fields to a COBOL subprogram that does not use the SYNC option.

If the COBOL subprogram does use the SYNC option or if the Assembler subprogram defines the binary fields with the H (halfword) or F (fullword) attribute, the CA Ideal programmer should insert the appropriate filler items in the non-Ideal subprogram parameter definition. For example, if the COBOL description is:

001000 LINKAGE SECTION.
001010 01  GROUP-ITEM.
001020     02  ALPHA-1                PIC X(1).
001030*       NOTE: COBOL INSERTS A "SLACK" BYTE HERE
001040     02  BINARY-2               PIC S9(4) COMP SYNC.

It is equivalent to the Assembler description:

              DS                  0D
GROUPITM      DS                  0XL4
ALPHA1        DS                  CL1
NOTE: ASSEMBLER INSERTS A "SLACK" BYTE HERE
BINARY2       DS                  H

The following is an example of a non-Ideal subprogram parameter definition:

1 GROUP-ITEM
2 ALPHA-1                         X   1
2 SLACK-1                         X   1
2 BINARY-2                        B   4

CA Ideal does not support binary numbers larger than nine decimal (base-10) digits. If it is necessary to pass a larger number to a non-Ideal subprogram, pass it as a zoned decimal or packed decimal field. If the field passed is a binary field larger than four bytes in a dataview, see the summary of storage requirements for each internal type in the concepts section of the Programming Reference Guide.

To determine what specification for the CA Ideal Characters/Digits column (number of decimal, or base-10, digits) is needed for a given number of bytes of storage for a non-Ideal subprogram, see the summary of storage requirements for each internal type in the concepts section of the Programming Reference Guide.

CA Ideal applications that access SQL databases might need to define fields that can receive null values. Every parameter field declared as a nullable field (WITH IND) passed as a parameter to a non-Ideal subprogram generates a two-byte NULL indicator field. For each parameter passed, the indicator fields are located following all the fields in the actual data structure passed to a non-Ideal subprogram. The location corresponds to the order in which the nullable parameters in the parameter data definition panel are defined.

If a parameter field is the object of OCCURs, then as many indicator fields are generated as there are occurrences of the parameter field. For example, given the following parameter data structure:

01 	PARM-1
  02	 A	. . . WITH IND
  02	 B	. . . OCCUR 3
    03	C	. . . WITH IND
    03	D	. . . OCCUR 3 WITH IND

The following null indicator fields are generated:

The COBOL description is:

01	PARM-1
  02	 A	. 	. .
  02	 B		OCCURS 3 TIMES . . .
    03	C		. . .
    03	D		OCCURS 3 TIMES . . .
  02	 A-IND	PIC S9(4) COMP.
  02	 C-IND	OCCURS 3 TIMES	PIC S9(4) COMP.
  02	 D-IND	OCCURS 9 TIMES	PIC S9(4) COMP.