How to identify in JCL that an input file is empty without
reading it?

Answer Posted / mainframeking

Usinf IDCAMS we can check:

//step01 dd exec pgm=idcams
//sysprint dd sysout=*
//input dd dsn=file name to check, disp=shr
//sysin dd *
print infile(input)character count(1)

if return code is 0, file is not empty
if return code is 4, file is empty

Is This Answer Correct ?    17 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

My Question is 1. How to cound no. of records in JCL. Please explain with an example. 2. How to execute only odd steps in JCL? I know EDIT TYPE = Inculde, Step Name = 1,3,5 and COND code for all even step. Anyone knows other than this.

1982


Differentiate between the joblib and the steplib statements?

855


I have a COBOL program that ACCEPTs some input data. How do you code the JCL statement for this?

694


What is the purpose of dd?

724


Is condition checking possible in jcl? If yes, how?

735






What is the function of the dd mgmtclas keyword in sms datasets?

730


can any one plzzzzzz tell the jcl code for creating ps using idcams

10509


What parameters can be used to limit the number of records written to a sysout dataset?

746


a dd statement has 2 types of parameters. Name them?

645


Is automatic restart possible in jcl?

733


Explain the hierarchy levels in jcl?

1118


What are the difference between jcl and jes?

1048


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

823


Explain the function of the steplib dd statement?

641


List in order the hierarchical levels of jcl?

664