How to find out the number of records in a file using JCL
Answer Posted / srinivasa gudla
Using Syncsort,
//SORT1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Input.File,DISP=SHR
//SORTOUT DD DSN=Output.File,...
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=OUT,TRAILER1=
(1:COUNT),REMOVECC,NODETAIL
/*
This job creates a report with a single trailer record
containing the record count.
The COUNT subparameter of TRAILER1 provides the number of
records for the entire report (all the records) starting at
position 1.
REMOVECC omits the ANSI carriage control character from all
of the report records.
NODETAIL generates a report with no data records, only
header and trailer records, as specified.
Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
what is the resolution for sb37 error
how you can access an uncataloged dataset in a JCL?
Does jcl support automatic restart?
A dd statement consists of 4 fields. Name them?
What is the function of the steplib dd statement?
How can unused space allocation be returned to the system when a dataset is closed?
what is DSN in JCL and what are the parameters to declare the DSN?
what is JCL?
Mainframes gets a text file that contains the name of the file. Now using JCL i want to locate that file name in the mainframe system and perform further processing. Please tell how to proceed
What is the motivation behind coding class parameter in job statement?
What parameters can be used to limit the number of records written to a sysout dataset?
What is concatenating?
when does a dataset go uncataloged?
I want to JCL sort for Non-COMP and COMP-3 fields SORT FIELDS=(1,5,A,6,11,A,12,11,A,19,1,A,20,1,A),FORMAT=BI,EQUALS Length of comp bytes is 11 bytes which start at 6byte and 12 byte considering 11 bytes in comp-3 is 6 bytes. Can anyone tell if the above sort work SORT FIELDS=(1,5,A,6,6,A,12,6,A,19,1,A,20,1,A),FORMAT=BI,EQUALS does not works OK
Mention the types of job control statements?