How to find out the number of records in a file using JCL

Answers were Sorted based on User's Feedback



How to find out the number of records in a file using JCL..

Answer / logeshwaran

//COUNT EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=INPUT DATASET,
// DISP=SHR
//TOOLIN DD *
COUNT FROM(IN)
/*

Is This Answer Correct ?    18 Yes 0 No

How to find out the number of records in a file using JCL..

Answer / mohanasundaram

step1 exec pgm=idcams
sysprint dd sysout=*
sysout dd sysout=*
infile dd dsn=filename,disp=shr
sysin dd *
print(filename)-
count(3)
/*
//

In input file 3 records is there means it will be show maxcc=0 else it will show maxcc=4

Is This Answer Correct ?    6 Yes 0 No

How to find out the number of records in a file using JCL..

Answer / 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

How to find out the number of records in a file using JCL..

Answer / ravi

Logesh,

I'm not sure where the output (record count) is written to.

Can you let me know how to write it to spool & dataset.

My output should be:

Record count is: <count>

Is This Answer Correct ?    2 Yes 2 No

How to find out the number of records in a file using JCL..

Answer / anilkumar

//COUNT EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=INPUT DATASET,
// DISP=SHR
//TOOLIN DD *
*option1
COUNT FROM(IN)
*Instead of count u can aslo use stats operator
*option2
stats from(IN) on(20,5,ZD)
*output will be available in spool ie.in toolmsg
/*

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More JCL Interview Questions

How to print the Output to SPOOL using MSGCLASS and SYSOUT ?

4 Answers   IBM,


Is automatic restart possible in jcl? If yes, how?

0 Answers  


What are the causes for S0C1, S0C4, S0C5, S0C7, S0CB abends ?

11 Answers   Tesco,


In JCL I have 5 steps,I need to execute 1st,2nd and 5th steps only,can any one answer me please?

2 Answers   TCS,


If the COND parameter is specified in both the JOB and EXEC statements, which one will take precedence? If JOB takes priority and if all the conditions evaluate to false, then will the conditions on the EXEC step be evaluated next?

4 Answers   Wipro,






What are the parameters that are used in creating a gdg?

0 Answers  


What parameter directs the output of the job log dataset?

0 Answers  


What is the format of comment statement?

0 Answers  


What do you do if you do not want to keep all the space allocated to a dataset?

2 Answers  


What is DISP= (NEW,PASS,DELETE)?

3 Answers   HCL,


What is the DD statement for a output file?

3 Answers  


how would you create a temporary dataset? And where will you use them?

0 Answers  


Categories