How to check empty file in jcl?

Answers were Sorted based on User's Feedback



How to check empty file in jcl?..

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

How to check empty file in jcl?..

Answer / sravani

using iebptpch

Is This Answer Correct ?    2 Yes 0 No

How to check empty file in jcl?..

Answer / arun sundar j

It can also be possible by using SPEMPTY

Is This Answer Correct ?    2 Yes 1 No

How to check empty file in jcl?..

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

Post New Answer

More JCL Interview Questions

what is the use of JCL?

0 Answers  


What is DSNDB06 ?

1 Answers  


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 ?

6 Answers   IBM,


What does a disposition of (MOD,DELETE,DELETE) mean ?

0 Answers  


What is a COND parameter in JCL?

10 Answers   TCS,






What methodology can be adapted to transfer data to a program that is coded using the exec statement?

0 Answers  


What statement marks the beginning of an in-stream or cataloged procedure in jcl and assigns default values to parameters defined in the procedure?

0 Answers  


I have a dataset with record length 40 in production, due to some requirements it was changed to 80. Then how can we know the jobs which are effected by this change and how can we resolve it.

3 Answers   iGate,


How does the jcl specify the job to os?

0 Answers  


If we want to see the eliminated duplicate record thru SORT, how its output file will be managed

6 Answers   Syntel,


How dummy is used in jcl?

0 Answers  


in ways data can be passed to a COBOL program from JCL?

0 Answers  


Categories