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

How to submit a jcl from cics?

658


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

1962


what is the use of JCL?

660


What is catelog procedure and how many catelog procedure to use in one job?

7437


What statement marks the beginning of a job step; assigns a name to the step; identifies the program or catalogued or in-stream procedure to be executed in the step?

643






How can a jobs execution priority be modified?

794


define cond parameter in jcl?

771


The disp in the JCL is MOD and the program opens the file in OUTPUT mode. What happens ? The disp in the JCL is SHR and the pgm opens the file in EXTEND mode. What happens ?

940


What do we mean by 'Virtual storage' for a dataset and for a JOBSTEP ? What is the significance of the following statement for a programmer 'Virtual storage results in program addresses being independent of the addresses that actually exist in a computer' ?

1579


what operation is performed by job statement?

656


Step 1 RC 4 Step 2 Step 3 I want to know the COND parameter which can be coded in step 2 or 3. Step 2 should be executed based on Step 1 RC and Step 3 should not be executed based on step 1's RC

582


what is the resolution for sb37 error

7700


WORKING-STORAGE SECTION. 01 GROSS-PAY. 05 BASIC-PAY PIC 9(5). 05 ALLOWENCES PIC 9(3). PROCEDURE DIVISION. MOVE 1000 TO BASIC-PAY. MOVE 250 TO ALLOWENCES. DISPLAY GROSS-PAY. STOP RUN. 77 W-A PIC 9(3)V99 VALUE 23.75 77 W-B PIC ZZ9V99 VLAUE 123.45 after the statement MOVE W-A TO W-B what will be W-B's value? a.123.75 b.b23.75 (where b indicates space) c.023.75 d.invalid move

852


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

648


We can use PASS with permanent datasets also. THEN Which is the condition in which we may use PASS (instead of KEEP) with permanent data sets, while there is no need to specify UNIT and VOL for them like temporary data sets (in cas we use KEEP for permanent data sets) ?

1764