Method and apparatus for dynamic invocation of utilities4587628Abstract A program controlled digital computer is operated according to a utility program, such as a sort program which manages input/output directly (using very efficient execute channel programs (EXCP) or basic sequential access method (BSAM) facilities of the operating system), but in such a way as to provide to the caller (that is, the application program) the status and error information that is required. This is accomplished by defining an interface between the caller and sort enabling the caller to specify the names of the input and output data sets, the locations of routines to be executed for input and output, the locations of routines to be executed upon exit from input/output routines, and data areas for status information. Responsive to the interface, the sort process (1) selectively calls input/output exit routines provided by the caller, passing one record at a time over the interface, or provides to the operating system its own channel program for input/output with respect to a plurality of record, and (2) provides to the operating system information enabling the operating system to communicate error and status information directly to the application program. Claims We claim: Description BACKGROUND OF THE INVENTION
TABLE 1
______________________________________
EXTENDED PARAMETER LIST
Offset Bit
Decimal
0,1-31
______________________________________
102 0 O,Address of control statements area (zeros if none)
112 4 f,Address of E15 or E32 routine (zeros if none)
116 8 f,Address of E35 routine (zeros if none)
118 12 User exit address constant (zeros if none)
120 16 Address of ALTSEQ translation table (zeros if none)
130 20 Address of STAE area field (zeros if no STAE routine)
138 24 f,Address of E18 routine (zeros if none)
142 28 f,Address of E39 routine (zeros if none)
144 32 X`FFFFFFFF`
where for an MVS/XA operating system environment,
f=0 means enter the exit with 24-bit addressing in effect
f=1 means enter the exit with 31-bit addressing in effect
______________________________________
Control statements pointer 102 provides the address of control statements list 108, an area containing the sort/merge control statements, if any. Control statements list 108 includes length field 104, containing the length of the character string to follow, and a character string illustrated as including portions 124, 126. This character string contains images of sort/merge control statements to be used at execution time, with each control statement separated by one or more blanks. Sort/merge control statements include, for example, those described in IBM OS/VS Sort Programmer's Guide, IBM Publication SC33-4035, and others, as follows: ALTSEQ, for specifying modifications to the IBM EBCDIC collating sequence; DEBUG, for use when diagnostic information is required for debugging; END, for causing sort 66 to discontinue reading the input file; INCLUDE, for specifying that only records whose fields meet certain specified criteria be included; OMIT, for specifying that records whose fields do not meet certain criteria be deleted; INREC, for specifying how records are to be reformatted before they are sorted; MERGE, for providing the same information as a SORT statement if the application is a merge; MODS, for including user routines in the sort application; OPTION, for overriding installation defaults and for providing optional information; OUTREC, for specifying how records will be reformatted before they are written to sortout; RECORD, for providing record length and type information; SUM, for specifying that summary fields in records with equal control fields be summarized in one of the records, and that the other records be deleted; and SORT, for providing information about control fields and data set size. Of these, the most pertinent to the dynamic invocation aspect of the invention is illustrated by the OPTION control statement, showing in field 124 the string "SORTIN=DD--NAME--OF--INPUT--DATA--SET,", and in field 126 the string "SORTOUT=DD--NAME--OF--OUTPUT--DATA--SET". By these control statements, application program 68 specifies the names of the data sets containing the input file and the output file for use by sort 66 when executing the fast sort option. The syntax of the SORTIN control option is "SORTIN=ddname" or "SORTIN=SORTIN". It specifies the DDname to be used for sort input when sort 66 is dynamically invoked. The standard default is SORTIN, or ddnmIN if SORTDD=ddnm was specified. SORTDD=ddnm is an option control card used to supply the first four characters for DDnames SORTIN and SORTOUT when sort 66 is invoked more than once by the same caller 68. This option is used if it is specified on an OPTION control statement in control statements list 108. The syntax of the SORTOUT control option is "SORTOUT=ddname" or "SORTOUT=SORTOUT". It specifies the DDname to be used for sort output when sort 66 is dynamically invoked. The standard default is SORTOUT, or ddnmOUT if SORTDD=ddnm was specified. This option is used if it is specified on an OPTION control statement in control statements list 108. Exit E15 address field 112 specifies the addressing mode and the address of the exit E15 routine 160, if any. Exit E35 address field 116 specifies the addressing mode and the address of the exit E35 routine 162, if any. Address constant field 118 specifies the user exit address constant, if any. This field is passed by sort 66 to user exits E15 and/or E35, and is used to point to a parameter list or work area created by the user (not shown). For dynamically invoked sort, the user can initialize the user exit address constant 118. It will be passed to the first exit as it is received from the caller (or user), and passed to the second exit as it is received from the first exit. The user can, for example, GETMAIN an area in the E15 routine and pass the address of the area to the E35 routine even though they are not in main storage at the same time. (Virtual storage 60 includes real and pageable storage.) When invoking sort using 31-bit addressing mode, user address constant field 118 is passed to exit E15 in the E15 parameter list, such that the E15 parameter list will include the address of the new record concatenated to the user exit address constant. Exit E15 can change the user exit address constant, and sort 66 passes it exactly as it was received from the E15 exit. The user address constant field is passed to exit E35 in the E35 parameter list, such that the E35 parameter list will include the address of the record leaving sort 66, concatenated to the address of the record in the output area, concatenated to the user exit address constant. Collating sequence table address (ALTSEQ) 120 is a pointer to translate table 122, a table provided by user 68 instead of an ALTSEQ control statement, if any, which, if provided, overrides any translate table given at installation time. Status area address pointer field 130 provides a pointer to status area address field 132, which in turn points to status area 134. Status area 134 is a specify task asynchronous exit (STAE) (for VS1) or ESTAE (for MVS) save area for use if the STAE or ESTAE routine receives control in the event of abnormal termination of sort, and the STAE or ESTAE work area is to be saved. Exit E18 address 138 specifies the addressing mode and the address of the user supplied E18 exit routine 164, if any. Exit E39 address 142 specifies the addressing mode and the address of the user supplied E39 exit routine 166, if any. Field 144, containing X`FFFFFFFF` terminates the extended parameter list 101. By use of extended parameter list 101, the caller can pass 31-bit addresses or "clean" 24-bit addresses to sort 66, can specify the addressing mode to be in effect when sort 66 enters a caller-loaded exit, and the caller can code all of the sort control statements in the callers program. Table 2 sets forth a pseudo-code description of the manner in which extended parameter list 101 is processed by sort 66 to establish the control structure to be described hereafter with respect to FIG. 5. This processing of the parameter list 101 occurs during an initialization phase, just after sort 66 is invoked (step 400, FIG. 6 and before step 440, FIG. 8). Further referring to FIG. 5, if exit E15 address 112 is specified, when an input record is to be read, sort code 150 enters E15 routine 160 to pass control to the caller for processing the input data set. If no exit E15 address 112 is provided, sort code 170 executes its own EXCP or BSAM procedure 174 for reading the data set specified by SORTIN option statement 124. EXCP processing is explained in the IBM System Programming Library: Data Management, IBM publication number GC26-3830-3, at pages 61-100.1. This input process is further set forth in the pseudo-code description of Table 3, and in FIGS. 8 and 9. By these techniques, sort 66 can pass to OS 62 the CCW chain optimizing the input/output processing of the input/output datasets. A typical channel program, or CCW chain, for reading a plurality of blocks with one EXCP, is set forth in FIG. 11, which will be described hereafter. If exit E35 address 116 is specified, when an output record is to be written, sort code 152 enters E35 routine 162 to pass control to the caller for processing the output data set. If no exit E35 address 116 is provided, sort code 172 executes its own EXCP or BSAM procedure 176 for writing to the data set specified by the SORTOUT option statement 126. This output process is further described in pseudo-code in Table 4, and in connection with FIGS. 8 and 10. Procedure 176 will typically include a channel program, such as that set forth in FIG. 12, which will be described hereafter. Referring still to FIG. 5, application 68 may provide E18 routine 164 and/or E39 routine 166, specifically tailored to its own requirements. Previously, such routines were provided in a library, not tailored to the application--which could therefore not be assured of getting I/O error and data set status information. If exit E18 address field 138 is provided in extended parameter list 102, sort 66, 154 invokes exit E18 routine 164, a routine supplied by user 68. Exit E18 routine 164 loads register R1 (180) with address X1, the address of input data set control parameter list 184, and returns back to sort 154. Parameter list 184 includes SYNAD address 190, exit list EXLST address 192, and end of data (EOD) address 194. These are set by exit routine 164, which was provided by caller 68. Sort 154 will then process the fields in list 184 by placing them in several control blocks for subsequent use by sort 66 during processing of the sortin data set. One of those control blocks is the DCB for input 210, which is established by sort 66 and described by COMINDCB 218. DCB for input 210 I/O block (IOB) 216 contains control structures used by sort 170 when doing EXCP processing 174. Thus, control block IOB 216 has the initial CCW's which are chained by a transfer in channel (TIC) to further CCW's required to perform EXCP process 174, as will be further described in connection with FIG. 11. SYNAD address 190 is placed into DCBSYNAD 212, EXLST address 192 into DCBEXLST 214, and EOD address 194 into COM18ND 224. COM18ND 224 is the address of EOD routine 222, which is supplied by caller 68 for use by sort 66 when the end of sortin data set is encountered during input. SYNAD routine 220 is the routine supplied and built by caller 68 to process errors that occur during processing of the sortin data set. DCBEXLST 214 is the address of exit list 230, which contains the addresses of various user 68 supplied functional routines. These functional routines are delimited by a functional code identifier, and the address of the functional routine. Examples of such routines are OPEN 232, with address 234 of open exit routine 236, CLOSE 240, with address 242 of close exit routine 244, and EOV 246. Open exit routine 236 and close exit routine 244 are supplied by user 68 for use by sort 66 when the input data set is opened, or closed, respectively. If exit E39 address field 140 is provided in extended parameter list 102, sort 66, 156 invokes exit E39 routine 166. It loads register R1 (182) with address X2, the address of output data set control parameter list 186, and returns control to sort 156. Parameter list 186 includes SYNAD address field 196 and exit list EXLST address 198. These are set by exit routine 166, which was provided by caller 68. Sort 156 will then process the fields in list 186 by placing them in DCB for output 200, a control block initially established by sort 66 and described by COMUTDCB 208 for use by sort 66 during processing of the sortout data set. It contains control structures and channel command routines for use by routine 172 when doing EXCP processing 176. Thus, control block 200 contains in IOB 206 the initial CCW's which are chained by a transfer in channel (TIC) to further CCW's required to perform EXCP process 176, as will be further described in connection with FIG. 12. SYNAD address 196 is the address of a SYNAD routine (not shown, but like 220) provided by user 68 for processing errors encountered during writing the sortout data set. It is placed by sort 156 into DCBSYNAD 204. EXLST address 198 is the address of an exit list (not shown, but like 230) provided by user 68, containing the addresses of various user 68 supplied functional routines for processing the sortout data set. It is placed by sort 156 into DCBEXLST 202. Referring now to FIG. 6, a description will be given of the method of the invention for managing the sort/application interface in the event of an error during reading of the sortin data set. In step 400, application 68 sets up extended parameter list 101, and invokes sort 66, which processes the parameter list according to the procedure set forth in Table 2. Referring to Table 2, lines 1 through 5 relate to initialization of sort 66 when invoked from a job control language (JCL) environment--without use of extended parameter list 101, which may be used if sort 66 is dynamically invoked. In lines 6 through 62 the parameter list is scanned to identify those fields having significant entries. In lines 63-74, if control statements were passed, these are examined to identify the sortin and sortout data set names. In lines 75-88, if a sortin data set was named in the control statements, DCB and IOB control blocks 210 are built. In lines 89-101, if a sortout data set was named in the control statements, DCB and IOB control blocks 200 are built. In lines 102-111, if an exit E18 routine was identified in the parameter list, that exit is called, and the parameter list it supplies is processed. In lines 112-120, if an exit E39 routine was identified in the parameter list, that exit is called, and the parameter list it supplies is processed. Referring again to FIG. 6, as previously described, sort 66, in step 402, determines if application 68 provided an error routine 220 by examining exit E18 address field 138. If field 138 so indicates, in step 406 (see steps 102-111 in Table 2) sort 66 establishes addressability to error routine 220 by executing E18 routine 164 and storing, or saving, SYNAD address 190 into DCBSYNAD 212, as previously described. In step 408 (see also, Table 2 steps 18-23), sort 66 examines exit E15 address field 112 in extended parameter list 101 to determine if application 68 will manage input. If an exit E15 address is provided, in step 410 sort 66, 150 invokes user supplied exit E15 routine 160 to read in the input records. Otherwise, in step 412, sort 66, 170 invokes EXCP or BSAM process 174 to read in the sortin data set identified in the SORTIN parameter 124 of the option control statement 108. (This is further described in Table 2 at lines 76-88, and in Table 3 at lines 1-15, 20-30.) In step 414, if no error occurs during input of the sortin data set, control passes to step 422 for sorting the input. If an error occurs, and if an error routine 220 has been provided by application 68, that routine is executed at step 416 to provide to application 68 the status and error information available from OS 62. The application can, in step 418, determine if the sort should continue at step 422, or terminate 420. (See also Table 3, lines 18 and 30.) Referring to FIG. 7, processing of errors encountered during write to the sortout data set is described. (This is further described in Table 4, lines 1-25.) At step 424, sort 66 determines, by reference to exit E35 address field 116 in extended parameter list 101, if application 68 will manage output of sorted records to the sortout data set. If so, in step 426 sort 66,152 invokes exit 35 routine 162 to write out the records. If not, in step 428, sort 66, 172 executes EXCP or BSAM output routine 176, which calls OS 62 to write the sorted records to the sortout data set identified in SORTOUT option control statement 126, using the CCW chain begun in IOB 206 and further described in connection with FIG. 12. In step 430, if an error occurred during write to the sortout data set, in step 432 the SYNAD routine provided by application 68 and addressed by DCBSYNAD 204 is executed by OS 62 to pass status and control to application 68. Otherwise, the sort process ends 420. Referring now to FIGS. 8-10, a description of the method of the invention for reading and writing to sortin and sortout data sets, respectively, selectively under control of application 68 and sort 66, will be described. Typically, a sort process comprises three phases and an initialization phase. In accordance with this invention, during the initialization phase, if sort is dynamically invoked, the extended parameter list 101 is processed in accordance with the procedure previously discussed in connection with Table 2. Thereafter, during phase 1, the sortin data set is read in and strings of ordered records organized in storage and/or on external devices (sortwork). During phase 2, referred to as the intermediate merge phase, these strings are manipulated to form longer and fewer strings. And during phase 3, the final merge phase, the strings generated during phase 2 are written to the sortout data set. In accordance with this invention, the reading and writing of records with respect to the sortin and sortout data sets may be managed selectively under control of application 68 or sort 66, as determined by application 68 and indicated by the presence or absence of address fields in exit E15 address field 112 (for input) and exit E35 address field 116 (for output). Further, in accordance with this invention, the address mode bits in extended parameter list 101 fields 116, 118 indicate whether, for example, 24 bit or 31 bit addressing is to be used when an exit routine 160, 162 is invoked. In step 440, if user 68 has provided exit E15 routine 160, sort 66 calls that routine to receive a record from sortin. User 68 calls OS 62, routine 64 of which does the actual read using channel programs provided, generally, in a library routine (not shown). In step 444, upon return of control from application 68, sort 66 moves the input record from the location signalled by application 68 into record storage area (RSA) 76 in main storage 60. In steps 446, 448, and 450, if exit E15 processing 160 is not completed, and if RSA 76 is not full, sort 66 issues another call 442 to exit E15 routine 160 to read the next record in from sortin. As RSA 76 fills, in step 450 blocks of records are written to the sortwork data set on external devices 22. After the sortin data set has been read, as determined at step 446, the records remaining in RSA 76 may be written to sortwork, and processing continues to phase 2 at step 454. During phase 3, at step 460, if user 68 has provided an exit E35, in step 562 sort 66 reads in the strings to be finally merged from sortwork 152, in step 464 determines the winning record (next record for output), and in step 466 passes that record to exit E35 routine 162. Steps 464, 466, and 468 are repeated until the last record has been written to sortout, whereupon the sort process ends at step 470, and control is returned to caller 68. Referring now to FIG. 9, if in step 440 (FIG. 8) it was determined that sort 66 is to do input processing without invoking a user supplied E15 exit routine, then in step 480 sort 66, 170 (executing code at 170 and 206) issues a request to OS 62 to read a block of records from sortin 22 referenced by COMINDCB 218. In FIG. 11 is set forth a typical READ channel program, such as may be provided to OS 62 by sort 66. In FIG. 11, the SET SECTOR 520, SEARCH ID EQUAL 522, TIC 524 and TIC 526 commands initiating the READ channel program are provided in IOB 216, with TIC 526 transferring control to code (not shown) outside of IOB 216, containing for each sortin buffer provided in main storage 60 the CCW's READ MULTI-TRACK COUNT 530, READ MULTI-TRACK DATA 532, and TIC TO NEXT CCW 534, and for the last sortin buffer the CCW's READ MULTI-TRACK COUNT 536 and READ MULTI-TRACK DATA 538. Referring further to FIG. 9, sort 66 receives back control from OS 62 at step 482, and in step 484 places the records in RSA 76. If, in step 486, it is determined that RSA 76 is filled, in step 488 strings of records are written from RSA to sortwork on devices 22, 24. In steps 490 and 492, after the sortin file has been read in, and if an exit E18 routine 164 was passed by user 68 to sort 66, then sort 66, 170 invokes that routine. When control is received back, processing continues into phase 2 at step 454. If an error occurred during the read process under control of OS 62, then control would not have returned to sort 66 at step 494 until OS 62 had invoked the procedure at step 416 (FIG. 6). Referring now to FIG. 10, if in step 460 (FIG. 8) it was determined that sort 66 would do output, and in step 508 it is determined that user 68 had passed exit E39 166, then exit E39 166 is invoked to allow the user to pass output dataset control parameter list 186 to sort 156. In step 500, sort 66 merges records from strings in RSA 67 into sortout buffers in main storage 60, and in step 502 issues a request to OS 62 to write out to the sortout data set on external devices 22, 24 the output records pointed to by COMUTDCB 208. In issuing the request to OS 62, sort 66 will provide a channel program comprising a write channel program, such as set forth in FIG. 12. Herein, this channel program will be contained within or referenced from IOB 206, and includes SET SECTOR 540, SEARCH ID EQUAL 542, TIC 544, TIC 546, and for the first n-1 (where n is the number of sortout buffers) sortout buffers WRITE COUNT KEY DATA 548 and TIC TO NEXT CCW 550, and for the last (nth) sortout buffer WRITE COUNT KEY DATA 552. Upon receiving control in step 504, and if end of data has occurred, then control passes to step 470, and sort 66 is finished. If an error occurred during the write process under control of OS 62, then control would not have returned to sort 66 at step 504 until OS 62 had invoked the procedure of step 532 (FIG. 7).
TABLE 2
__________________________________________________________________________
PROCESS PARAMETER LISTS
__________________________________________________________________________
If JCL Invoked Then
do;
Set Flag saying JCL Invoked
Process Parameters from JCL EXEC card
end;
Else {Dynamically Invoked}
Do;
If 31-Bit parameter list 101 passed Then
Do;
Set Flag indicating 31-bit parameter list
If control statements pointer 102 is not 0 then
If length field 104 pointed to by controls statements pointer 102
is not 0
do;
save starting address 106 of control statements 108
save length 104 of controls statements 108
end;
If this was the last entry, goto End --of --Parameter --List
{Process E15 Entry Point & Addressing mode}
If E15 Address 112 was passed (is non-zero) Then
Do;
Set E15 Input Mod flag showing Caller will be supplying input
Save Address and Addressing mode of E15 exit 160
End;
If this was the last entry, goto End --of --Parameter --List
{Process E35 Entry Point & Addressing mode}
If E35 Address 116 was passed Then
Do;
Set flag showing Caller will be handling output
Save Address and Addressing mode of E35 exit 162 in COMEXITS
table
End;
If this was the last entry, goto End --of --Parameter --List
{Process Users Address Constant}
Save the Users Adcon field 118
If this was the last entry, goto End --of --Parameter --List
{Process ALTSEQ Table Address}
If an Alternate collating sequence table address 120 was passed
Do;
Save address of ALTSEQ table 122
Set flag showing table 122 was passed from parameter list 101
End;
If this was the last entry, goto End --of --Parameter --List
{Process (E)STAE Status Area Address Pointer}
If an (E)STAE Status Area Address Pointer 130 was passed Then
Do;
Save Status Area 134 Address
Set flag showing (E)STAE status area present
End;
If this was the last entry, goto
End --of --Parameter --List
{Process E18 Entry Point & Addressing mode}
If E18 Address 138 was passed Then
Do;
Save Address and Addressing mode of E18 exit
End;
If this was the last entry, goto End --of --Parameter --List
{Process E39 Entry Point & Addressing mode}
If E39 Address 142 was passed Then
Do;
Save Address and Addressing mode of E39 exit in COMEXITS table
End;
If this was not the last entry
Then Set flag showing error in parameter list
End --of --Parameter --List:
If control statement 108 was passed in address pointer
102, in the parameter list 101 Then
Do;
Scan the keyword cards 108 for the presence of an `OPTION` control
card.
If OPTION card is located Then
Do;
If SORTIN keyword 124 is present on OPTION card
Set the ddname specified by this keyword into COMSORTN
Otherwise set `SORTIN` into COMSORTN
If SORTOUT kcyword 126 is present on OPTION card
Set the ddname specified by this keyword into COMSORTO
Otherwise set `SORTOUT` into COMSORTO.
End;
{Locate and process all relevant DD cards for Sort}
If SORTIN 124 was passed on the OPTION control statement
Then If Caller 68 is not performing the Input
Then validate that ddname in COMSORTN is known to the operating
system
If ddname waa found, then
Do;
Build DCB and IOB control blocks 210 for the supplied
SORTIN ddname. Save the pointer to the DCB in COMINDCB 218.
Note: As all I/O references to SORTIN use COMINDCB, the
ddname passed with the SORTIN keyword will be used
as the SORTIN file.
End;
Else issue error message and return to caller.
Otherwise IGNORE SORTIN dd because caller is supplying input.
If SORTOUT 126 was passed on the OPTION control statement
Then if Caller 68 is not processing the Output
Then validate that ddname stored in COMSORTO is known to system
If ddname was known, then
Do;
Build DCB and IOB control blocks 200 for the supplied
SORTOUT ddname. Save the pointer to the DCB in COMUTDCB 208.
Note: As all I/O references to SORTOUT use COMUTDCB, the
ddname passed with the SORTOUT keyword will be used
as the SORTOUT file.
End;
Else issue error message and return to caller
Otherwise IGNORE SORTOUT because caller is handling output.
If an E18 exit 164 is present, then
Call E18 exit.
Proccss the parameter list 184 passed back from the E18 exit
setting values in the DCB 210 pointed to by COMINDCB 218.
COMINDCB points either to the SORTIN DD card or the DD card
passed by the SORTIN keyword of the OPTION control card.
IF SYNAD address 190 passed in list 184, set DCBSYNAD field 122
with value.
IF EXLST address 192 passed in list 184, set DCBEXLST field 214
with value.
IF EOD address 194 passed in list 184, set COME18ND field 224 to
EOD 222 address.
End;
If an E39 exit is present, then
Call E39 exit 166.
Process the parameter list 186 passed back from the E39 exit setting
values in the DCB 200 pointed to by COMUTDCB 208. COMUTDCB points
either to the SORTOUT DD card or the DD card passed by the SORTOUT
keyword of the OPTION control card.
IF SYNAD address 196 passed in list 186, set DCBSYNAD field 204
with its value.
IF EXLST address 198 passed in list 186, set DCBEXLST field 202
with its value.
End;
__________________________________________________________________________
In Tables 5 and 6 are set forth an example showing the use by caller 68 of the dynamic invocation technique of the invention. The job control language (JCL) for program MYSORT and highlights of the code for program MYSORT are shown in Tables 5 and 6, respectively.
TABLE 5
______________________________________
JCL FOR MYSORT
//EXAMP JOB A400,PROGRAMMER
//EXEC PGM=MYSORT 01
//MSGOUT DD SYSOUT=A 02
//SORTIN DD DSNAME=INP1,DISP=OLD,
UNIT=3350
//DCB=(RECFM=FB,BLKSIZE=7200,LRECL=80),
VOL=SER=335001
//SORTOUT DD DSNAME=&&OUTPUT,DISP=(,PASS),
UNIT=SYSDA,
//SPACE=(CYL,(5,1)),DCB=(RECFM=F,LRECL=111)
//SORTWKOI DD SPACE=(CYL,(10)),UNIT=3350
03
//SORTCNTL DD * 04
OPTION EQUALS,FILSZ=E30000,NOWRKSEC
05
INCLUDE COND=(5,8,GT,13,8),FORMAT=FI
06
OUTREC FIELDS=(5X,5,8,5X,13,8,5X,1,80)
07
/* 08
//SYSOUT DD SYSOUT=A 09
______________________________________
Referring to Table 5, line 01, the EXEC statement specifies the name of the program 68 calling sort/merge 66. At line 02, the MSGOUT DD statement directs the sort/merge messages to output class A. At line 03, the SORTWK01 DD statement describes a temporary work data set on an IBM 3350 storage device 22 containing 10 cylinders. At line 04, the SORTCNTL DD statement indicates that a data set follows in the input stream. At line 05 appears the OPTION statement. EQUALS specifies that the order of records with equal control fields is to be preserved, overriding the standard default of EQUALS=NO. FILSZ=E30000 specifies the estimated number of records to be sorted, overriding FILSZ=E25000 in the OPTION statement of the invocation parameter list.. NOWRKSEC specifies that no automatic secondary allocation is to take place for the temporary work data set, overriding the standard default of WRKSEC=YES. Line 06 is the INCLUDE statement. COND and FORMAT specify that input records in which the fixed-integer number in positions 5 to 12 is greater than the fixed-integer number in positions 13 to 20 are the only input records which will be included in the output data set. The INCLUDE statement causes the OMIT statement of the invocation parameter list to be ignored. Line 07 is the OUTREC statement. FIELDS specifies how the input records are to be reformatted before they are output. The output records will be fixed-length, with a record size of 111 bytes. They will look as follows: position 1-5, blanks; position 6-13, input positions 5-12; position 14-18, blanks; position 19-26, input positions 13-20; position 27-31, blanks; and position 32-111, input positions 1-80. Line 08 marks the end of the SORTCNTL data set. Line 09, because SYSOUT DD statement is used by MYSORT, it cannot be used by sort/merge. Referring to Table 6, line 10 marks the start of the MYSORT program. In this example, assume that it GETMAINs a workarea, saves its address in register 2, and initializes the workarea for use by its E15 routine. At line 11, before calling sort/merge, MYSORT places the address of the parameter list to be passed to sort/merge in register 1, places the address of the GETMAINed workarea in the user exit address constant field in the parameter list, and indicates that the user exit address constant field is the last field in the parameter list (that is, there is no ALTSEQ table or STAE routine). Then MYSORT calls sort/merge. At line 12, the parameter list which MYSORT passes to sort/merge contains the address of the control statements area, the address of the E15 routine, and the address of the GETMAINed workarea. It indicates there is no E35 routine. At line 13, the control statements area contains the length of the control statements character string, followed by the character string which contains a SORT statement and an OPTION statement. Line 14 is the SORT statement. FIELDS specifies a control field in the input records. Line 15 is the OPTION statement. RESINV=2048 specifies the number of bytes to be reserved for the invoking program (MYSORT), overriding the standard default of RESINV=0. FILSZ=E25000 specifies the estimated number of records to be sorted. (There is no standard default for FILSZ.) MSGDDN=MSGOUT specifies the DDname to be used for program messages, overriding the standard default of MSGDDN=SYSOUT. Note that RESINV=2048 and MSGDDN=MSGOUT cannot be overridden by corresponding options specified in the SORTCNTL data set; these options are ignored when specified in the SORTCNTL data set because it is too late to use them when they are read. Line 16 is the OMIT statement. COND and FORMAT specify that input records in which the fixed-integer number in positions 5 to 12 is equal to the fixed-integer number in positions 13 to 20 are to be deleted. At line 17, the E15 routine receives control once for each input record before the input record is processed by sort/merge. At line 18, the parameter list passed to E15 by sort/merge will contain the address of the input record, and the address of the workarea which was GETMAINed and initialized by MYSORT. The cumulative effect of the control statements in the SORTCNTL data set and the control statements in the invocation parameter list is the equivalent set of control statements for the run set forth in Table 7. Having shown and described one embodiment of this invention, those skilled in this art will appreciate that many variations and modifications can be made to practice the invention and still be within the spirit and scope thereof. Thus, the invention is intended to be limited only by the claimed matter as indicated in the claims hereinafter set forth.
TABLE 7
______________________________________
EQUIVALENT CONTROL STATEMENT SET
SORT FIELDS=(4,5,CH,A)
OPTION EQUALS,FILSZ=E30000,NOWRKSEC,
RESINV=2048,MSGDDN=MSGOUT
INCLUDE COND=(5,8,GT,13,8),FORMAT=FI
OUTREC FIELDS=(5X,5,8,5X,13,8,5X,1,80)
______________________________________
|
Same subclass Same class Consider this |
||||||||||
