How to check empty file in jcl?

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

The disp in the JCL is MOD and the program opens the file in OUTPUT mode. What happens ? The disp in the JCL is SHR and the pgm opens the file in EXTEND mode. What happens ?

945


What do you know about jcl?

649


define cond parameter in jcl?

773


What is the purpose of the dd keylen parameter?

724


what are the statements that are not valid to be included in an include statement?

776






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

816


which utility is used a dummy utility?

791


Explain how can values be passed from the job stream to an executable program?

622


what happens when COND is coded in JOB statement and when COND is coded inside EXEC statement?

773


Explain how can a stopped job be started again?

636


How is the record format of an output dataset specified?

743


how do you code a null statement?

780


what is “Cond= even” and “Cond=only”?

740


How does jcl specify the job to the operating system?

751


What statement can be used to send data to another mvs jes3 node?

826