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

Which statement is used to identify the private libraries in job?

682


How to pass data to a program that is coded in an exec statement?

837


How does jcl act on a cobol code?

659


what are the types of abends that occur on job failure? And explain the possible causes of these

1123


how you can direct the data to spool using SYSOUT option?

931






What is the function of a dd statement?

709


What do you know about jcl?

651


Where can program checkpoints be stored for use in a restart?

851


Explain about LMQUERY�give a dialog information about a data set

906


What is the function of //cntl statement?

833


Define concatenating?

669


how do you create a dataset in a jcl with the same file organisation as that of another existing dataset?

811


Is it possible to left uncode disp?

717


Explain the function of dd name parameter with a 2 part structure; audit.report?

906


how you will the direct the data to spool using sysout option?

1769