To invoke CULSPAN:
The source code for CULSPAN is written in COBOL, as shown in the following figure. Instructions for defining the input file in the source code follow the COBOL listing.
Col 2 ▼ INPUT maximum-record-size-n V block-size-n UM ( CULSPAN )
CULSPAN is supplied in source form only. Each site must adapt CULSPAN for its use by changing the COBOL statements that describe the input file.
001000 IDENTIFICATION DIVISION. 002500* CONTAINS PTF # 83-01-0076 TJG 15:20:19 07/28/83 003000 PROGRAM-ID. CULSPAN. 005000 AUTHOR. CA, Inc. 009000 REMARKS. THIS PROGRAM IS AN INPUT MODULE WHICH 010000 READS AN INPUT REC INTO CULPRIT'S INPUT BUFFER. 012000 DATE-WRITTEN. mm/dd/yy 013000 DATE-COMPILED. mm/dd/yy 045000 ENVIRONMENT DIVISION. 047000 CONFIGURATION SECTION. 048000 SOURCE-COMPUTER. IBM-370. 049000 OBJECT-COMPUTER. IBM-370. 051000 INPUT-OUTPUT SECTION. 052000 FILE-CONTROL. 070000 DATA DIVISION. 072000 FILE SECTION. 073000 FD SPANNED-FILE 074000 BLOCK CONTAINS 2000 CHARACTERS 075000 LABEL RECORD IS LABEL-RECORD 076000 RECORD CONTAINS 187 TO 339 CHARACTERS 077000 RECORDING MODE IS S 078000 DATA RECORD IS SPANNED-RECORD. 079000 01 LABEL-RECORD PICTURE X(80). 080000 01 SPANNED-RECORD PICTURE X(339). 082000 WORKING-STORAGE SECTION. 084000 01 SELECT-SWITCH PICTURE X(1) VALUE ' '. 085000 01 SWITCH-VALUES. 086000 02 FILE-CLOSE-STATUS PICTURE X(1) VALUE '_'. 087000 02 FILE-OPEN-STATUS PICTURE X(1) VALUE '_'. 088000 02 FILE-STOP-STATUS PICTURE X(1) VALUE '_'. 089000* ************************************************************* 090000* * 091000* NOTE: INFORMATIONAL * 092000* * 093000* THE ABOVE THREE SWITCH VALUES ARE MULTIPUNCHED CODES. * 094000* THEY ARE AS FOLLOWES: * 095000* CLOSE IS HEX'FF' MULTI=12,11,0,7,8,9 * 096000* OPEN IS HEX'00' MULTI=12,0,1,8,9 * 097000* STOP IS HEX'0F' MULTI=12,7,8,9 * 098000* ************************************************************* 099000 01 ERROR-MESSAGES. 100000 02 ERROR-MSG1 PICTURE X(37) 101000 VALUE 'CULSPAN ERROR - INVALID CULARG SWITCH'. 102000 02 ERROR-MSG2 PICTURE X(31) 103000 VALUE 'CULSPAN ERROR - CULARG SWITCH= '. 105000 LINKAGE SECTION. 106000 01 CULARG-INPUT PICTURE X(80). 107000 01 CULARG-DEVICE-CODE PICTURE X(1). 108000 01 CULARG-SWITCH PICTURE X(1). 109000 01 CULARG-FORMAT-CODES PICTURE X(2). 110000 01 CULARG-RECORD-SIZE PICTURE 9(2) USAGE COMP. 111000 01 CULARG-BLOCK-SIZE PICTURE 9(2) USAGE COMP. 112000 01 CULARG-FILE-NAME PICTURE X(8). 113000 01 CULARG-DO-NOT-USE PICTURE X(1). 114000 01 CULARG-PRINT-ROUTINE PICTURE X(1). 116000 PROCEDURE DIVISION 118000 USING CULARG-INPUT 119000 CULARG-DEVICE-CODE 120000 CULARG-SWITCH 121000 CULARG-FORMAT-CODES 122000 CULARG-RECORD-SIZE 123000 CULARG-BLOCK-SIZE 124000 CULARG-FILE-NAME 125000 CULARG-DO-NOT-USE 126000 CULARG-PRINT-ROUTINE. 127000 129000 PARA01-CULSPAN-CONTROL. 130000 MOVE ' ' TO SELECT-SWITCH. 131000 IF CULARG-SWITCH = FILE-CLOSE-STATUS 132000 PERFORM PARA02-OPEN THRU PARA02-EXIT 133000 ELSE 134000 IF CULARG-SWITCH = FILE-OPEN-STATUS 135000 PERFORM PARA03-READ THRU PARA03-EXIT 136000 UNTIL SELECT-SWITCH = 'Y' 137000 ELSE 138000 IF CULARG-SWITCH = FILE-STOP-STATUS 139000 PERFORM PARA05-CLOSE THRU PARA05-EXIT 140000 ELSE 141000 PERFORM PARA06-SWITCH-ERROR 142000 THRU PARA06-EXIT. 143000 144000 GOBACK. 146000 PARA02-OPEN. 147000 OPEN INPUT SPANNED-FILE. 148000 MOVE FILE-OPEN-STATUS TO CULARG-SWITCH. 149000 PERFORM PARA03-READ THRU PARA03-EXIT 150000 UNTIL SELECT-SWITCH = 'Y'. 151000 PARA02-EXIT. 152000 EXIT. 154000 PARA03-READ. 155000 READ SPANNED-FILE INTO CULARG-INPUT 156000 AT END 157000 PERFORM PARA04-CLOSE THRU PARA05-EXIT 158000 MOVE 'Y' TO SELECT-SWITCH 159000 GO TO PARA03-EXIT. 160000 PARA03-SELECT. 161000 CALL 'CULLCBSL' USING CULARG-INPUT SELECT-SWITCH. 162000 PARA03-EXIT. 163000 EXIT. 165000 PARA04-CLOSE. 166000 MOVE FILE-CLOSE-STATUS TO CULARG-SWITCH. 168000 PARA05-CLOSE. 169000 CLOSE SPANNED-FILE. 170000 PARA05-EXIT. 171000 EXIT. 173000 PARA06-SWITCH-ERROR. 174000 DISPLAY ERROR-MSG1. 175000 DISPLAY ERROR-MSG2 CULARG-SWITCH. 176000 PERFORM PARA04-CLOSE THRU PARA05-EXIT. 177000 PARA06-EXIT. 178000 EXIT.
The z/VSE input file must be defined in the FILE SECTION of the CULSPAN source code, as shown below:
DATA DIVISION. FILE SECTION. FD SPANNED-FILE BLOCK CONTAINS number-of-characters CHARACTERS LABEL RECORD IS label-record-name RECORD CONTAINS minimum-record-size-n TO maximum-record-size-n CHARACTERS RECORDING MODE IS S DATA RECORD IS SPANNED-RECORD. 01 LABEL-RECORD PIC X(80). 01 SPANNED-RECORD PIC X(maximum-record-size-n).
Copyright © 2014 CA.
All rights reserved.
|
|