How to check empty file in jcl?
Answers were Sorted based on User's Feedback
Answer / muttaiah
There are so many utilities(ICetool, IDcams, Iebgener)
which we can make use to check whether a file is empty.
//Jobcard
//stepname exec pgm=idcams
//dd1 dd dsn=xxx.pds,disp=shr
//sysin dd *
print infile(dd1) count(1)
/*
Here the job will give a return code '0' if the file has
atleast 1 record and RC-4 if there are no records
Suppose you want to check whether any records are there
apart from header and trailer. then Make the count as Count
(3).
//sysin dd *
print infile(dd1) count(3)
/*
| Is This Answer Correct ? | 16 Yes | 0 No |
Answer / pradeep k (cr)
Thanks all for ur valuable answers, but i have one small
doubt.
I tried with ICETOOL, by giving empty input file and i am
able to sumit job with maxcc 000 and outptu is comming fine
as total recard count as 0.
in same way, i am trying to submit jcl provided by Muttaiah
but i am getting jcl error message like 'ILLEGAL KEYWORD
INT RINT' at the place of PRINT statement.
Can anyone suggest me, what's my mistake?
| Is This Answer Correct ? | 0 Yes | 0 No |
Can you code instream data in a PROC ?
how to split a file
how to compare two datasets without using superce because output is limited to 133 bytes
How I sort the records in a file and copy the first 10 records to another file
I have a job (4 steps) with time parameter coded in job & exec, say time=10 in job & time =3,2,2,4 in each steps. Will the job executes successfully?
A STEP has more than 1 file as INPUT. And we have to put all these records int 1 output file. How to do ? //InputF DD DSN=ID.File1 DSN=ID.File2 DSN=ID.File3
what is DD statement is used in JCL?
Which COND paramter will u use to execute the step only if the previous step does not execute
How to print data of sequential file to Spool..?
In JCL I have 5 steps,I need to execute 1st,2nd and 5th steps only,can any one answer me please?
what happens in conversion stage in job processing?
Explain concatenating datasets?