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


Please Help Members By Posting Answers For Below Questions

what is the resolution for sb37 error

8307


how you can access an uncataloged dataset in a JCL?

850


Does jcl support automatic restart?

960


A dd statement consists of 4 fields. Name them?

1156


What is the function of the steplib dd statement?

910






How can unused space allocation be returned to the system when a dataset is closed?

1080


what is DSN in JCL and what are the parameters to declare the DSN?

942


what is JCL?

902


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

2247


What is the motivation behind coding class parameter in job statement?

874


What parameters can be used to limit the number of records written to a sysout dataset?

971


What is concatenating?

837


when does a dataset go uncataloged?

1027


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

1689


Mention the types of job control statements?

900