CoolSpools Spool Converter exit programs and "missing" parameters: differences between V5 and V6

The command parameters EXITPGMPRM, EXITPGMPOS and EXITPGMKEY specify "user-defined" parameters (text extracted from inside the spooled file at run time) to be passed to CoolSpools exit programs.

EXITPGMPOS defines the text to be passed as a parameter based on retrieving the contents of a fixed position on the page (specified in terms of line and column number and a length in characters).

EXITPGMKEY defines the text to be passed as a parameter based on retrieving the contents of a position on the page at a horizontal offset in characters from a "key string". CoolSpools cans each line of the spooled file for the "key string" and extracts the text at the relative offset if the key string is found (e.g. the customer number to the right of a label "Customer number:").

There are circumstances in which the nature of the text that should be passed to the exit program, or whether anything should be passed at all, is a moot point. For example:

a) EXITPGMPOS specifies that the text to be passed is on line 10, but the page being processed ends on line 5.

b) EXITPGMKEY specifies a key string which does not appear in the spooled file or on the page being processed.

There is a difference between the way CoolSpools Version 5 (prior to January 2008) handled these conditions and the way they are handled by default by CoolSpools Version 6 and CoolSpools V5 after January 2008.

CoolSpools V5 before Jan 2008 would not pass any value in the user-defined exit program parameters for the corresponding EXITPGMPOS or EXITPGMKEY command parameters. This could give problems. For example, if there were two EXITPGMKEY parameters and the key string for only one of those parameters was found on the page, only a single user-defined exit program parameter would be passed, but the exit program had no means of determining which of the two had been selected.

CoolSpools Version 6 will (by default) always pass an exit program parameter corresponding to each EXITPGMPOS or EXITPGMKEY parameter element. If the EXITPGMPOS element references a non-existent area of the page, or if the EXITPGMKEY key string is not found, an empty (zero-length) string is passed as the corresponding exit program parameter.

This default behaviour can be altered by setting environment variable
CS_EXIT_TYPE23_PASS_MISSING_PARM to *NO. If this environment variable exists and is set to *NO, Version 6 and later editions of Version 5 will behave in the same way as the early editions of V5 and no exit program parameter value will be passed.

There is a related environment variable CS_EXIT_TYPE1_PASS_MISSING_PARM which controls the behaviour when calling *TYPE1 exit programs. The original *TYPE1 exit program specification supported only a single user-defined exit program parameter. This environment variable determines whether or not an empty string is passed if no exit program parameter value exists to pass. The default in V6 and later editions of V5 is to pass 1 parameter consisting of an empty string. Early editions of V5 did not pass any user-defined parameter at all, which could cause the exit program problems if it did not handle that condition.