Sample CA Culprit code containing INPUT, REC, and SELECT/BYPASS input definition parameters are shown and described below.
Example 1
IN 120 F VS(KS) REC EMP-NAME 1 25 'EMPLOYEE' 'NAME' REC EMP-SALARY 31 5 3 DP=2 'ANNUAL' 'SALARY' REC START-DATE 36 6 'EMPLOYEE' 'START DATE' REC START-MONTH 36 2 2 REC START-DAY 38 2 2 REC START-YEAR 40 2 2 SEL START-YEAR EQ (79 TO 84) AND EMP-SALARY GT 50000
Input is contained in a key-sequenced VSAM file that contains fixed-length records; each record in the file is 120 bytes. Because the file is in the z/OS environment, block-size is not specified.
REC parameters defining the fields of the input record follow the INPUT parameter. START-DATE is defined as an alphanumeric input field; however, three fields overlap START-DATE and redefine the data as zoned decimal for use in arithmetic operations and comparisons. For example, the SELECT parameter contains a numeric comparison for the values of START-YEAR. Input records are selected for personnel who were hired between 1979 and 1984 and who earn a salary greater than $50,000 per year.
Auto headers are defined for EMP-NAME, EMP-SALARY, and START-DATE. These are printed on output if referenced on a type 5 or type 6 edit parameter.
Example 2
IN 500 F MK=M-ACCOUNT MB=KEEP $MASTER-FILE REC M-ACCOUNT 1 7 'ACCOUNT NUMBER' REC M-CUST-NAME 8 25 'CUSTOMER' 'NAME' REC M-CUST-ADDRESS 33 45 'CUSTOMER' 'ADDRESS' IN 80 F MK=T-ACCOUNT $TRANSACTION FILE REC T-ACCOUNT 1 7 'ACCOUNT NUMBER' REC T-TRANACT-CODE 8 3 'TRANSACTION CODE' REC T-TRANACT-AMT 11 5 3 'TRANSACTION AMOUNT' SELECT T-TRANACT-CODE EQ 'DEB' BYPASS BUFFER WHEN M-ACCOUNT GT '50000'
Two input files are matched in this CA Culprit run. The master file is a sequential file that contains fixed-length records 500 bytes long; the transaction file is a sequential file that contains records 80 bytes long. The files are matched on account number as specified by the match key (MK) keywords M-ACCOUNT and T-ACCOUNT.
MB=KEEP is specified for the master file; CA Culprit keeps a record from the master file in the input buffer until M-ACCOUNT in a following master file record is either less than or equal to T-ACCOUNT in the transaction file.
Before the files are matched, records in the transaction file that specify transaction code DEB are selected. After matching logic constructs the input buffer, CA Culprit eliminates all buffers that have the an account number greater than 50000.
Note: For more information on match-file runs, see the CA Culprit for CA IDMS User Guide.
Example 3
IN 80 V DD=INPUT1 REC EMP-NAME 5 25 'EMPLOYEE NAME' REC INSURANCE-COV 30 GROUP AA 4.5 REC ANNUAL-COV 1 4 3 DP=2 ELMNT AA REC LOCATION-NUM 50 2 3 REC LOCATION-INFO 52 GROUP BB 8.LOCATION-NUM REC LOCATION-ID 1 2 ELMNT BB REC EXPIRATION-DATE 3 6 ELMNT BB IN 2 F 2 MB=DUMMY REC BINARY-RESULT 1 2
Input is a sequential file composed of variable-length records; the file is described on the DD statement INPUT1. The second INPUT parameter establishes two more bytes. The REC parameter BINARY-RESULT defines the content of the two bytes. The CA-supplied procedure module CULLUS33 (numeric field conversion) can be used to put a value in this field.
The records in the input file are variable in length because the multiply-occurring field LOCATION-INFO repeats any number of times depending on the value of LOCATION-NUM. Since the records are variable in length, EMP-NAME is defined with a start position of 5; the RDW occupies the first four bytes of each record.
|
Copyright © 2014 CA.
All rights reserved.
|
|