How to find out the number of records in a file using JCL
Answers were Sorted based on User's Feedback
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 |
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 ? | 7 Yes | 0 No |
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 |
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 |
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 |
What is the use of disp parameter?
I have DATE filed like DD-MM-YYYY, So I want output should be MM/DD/YYYY using JCL? Can anybody post the answer for above requirement?
4 Answers BirlaSoft, FIS, Wipro,
How to point my proc to production dataset always though i keep jcllib order=development.dataset? Is it possible?
What are the keywords associated with DCB? How can you specify DCB information? What is the OS precedence for obtaining that DCB information, ie. where does the system look for it first?
Explain the function of job statement in jcl?
Explain about REXX
describe the dd statement,its meaning,syntax and keywords?
How to read records in reverse order in flat file?
What is the purpose and meaning of the REGION keyword and what JCL statement is it associated with?
How to execute only th 15th step of JCL consisting of 50 steps?
What all are the changes to be made in JCL so as to do testing?
There are a set of 10 files and a customer will be selecting random no of files(i.e they may be more than 2, may not be in the order).Sometimes he might just select one file or sometimes no files at all.How do you code a JCL for this? Is it possible to code just JCL alone for this problem?