Procedure Modules › Dynamic Sequential File Processing (CULLUS01) › Helpful hints
Helpful hints
- If you use the CULLUSnn naming convention, you can prevent confusion by using numbers that are not found in the CA-supplied modules.
- An I/O error results in an abend. Check the system completion code that accompanies the abend to diagnose this error.
- The 1-character alphanumeric work field (task-v) first holds user instructions, which are later overwritten by CULLUS01 return values.
- When the return value is E, CULLUS01 has closed the file. An abend results if CULLUS01 is called again to close the file with a user-set value of S.
Example
This example uses CULLUS01 to retrieve customer account numbers from a sequential file during a database run.
The following code:
- Defines a database run
- Allows 1000 bytes (default) for the input buffer
- Uses a REC parameter (FIELD1) to define 5 bytes in the input buffer for the customer account number returned by US01
- Initializes work field EOFS to B, which directs CULLUS01 to open the input file and get the first record
- Issues a CALL to CULLUS01 from type 7 logic for record retrieval during the CA Culprit run
- Tests for end-of-file
DATABASE DICTNAME=DOCUDICT
INPUT DB SS=EMPSS01
PATHAA EMPLOYEE
REC FIELD1 95 5 $READ IN ACCOUNT NUMBER USING //US01 DD
010 EOFS 'B'
010 TEST ' '
013CULLUS01
0151*010 EMP-NAME-0415 HH 'NAME'
0151*020 FIELD1 HH 'ACCOUNT'
0151*040 TEST HH 'RETRIEVAL'
017010 CALL US01 (FIELD1,EOFS)
017 IF EOFS = ' ' 200
017 IF EOFS = 'E' STOP
017200 MOVE 'OK' TO TEST
REPORT NO. 01 CULLUS01 mm/dd/yy PAGE 1
NAME ACCOUNT RETRIEVAL
KATHERINE O'HEARN 15060 OK
PHINEAS FINN 21056 OK
NANCY TERNER 29557 OK
BETH CLOUD 30115 OK
JAMES JACOBI 33470 OK
TOM FITZHUGH 69876 OK
DOUGLAS KAHALLY 99083 OK
Copyright © 2014 CA.
All rights reserved.
|
|