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 |
Is stepname is a MUST and should be unique also for each JOBSTEP ? or system can supply the stepname for a step which is not given a name by the programmer ?
What are the differences between JES2 & JES3 ?
how can u identify the db2 from jcl ?
Which is the most widely used batch performance monitor for DB2?
I have 3 duplicate records in a file . I want to eliminate 1st, 2nd and copy 3rd one only . HOW ?
How to submit a jcl from cics?
i have a file which contains duplicates ? my requirement is to eliminate duplicates and these elminated duplicates should be moved to another file can any code this using sort ?
i have a jcl containing header body and trailer .in header i have viswa body 2 6 1 9 7 trailer reddy .now i need to sort only body in either asecending or descending order how can i do it
What is difference between Return Code, user completion code, Abend code and reason Code?
What is a S0C4 error ?
Explain about ISPF/TSO Commands
For how long a job can be executed continuously in a mainframe ?