How to identify in JCL that an input file is empty without
reading it?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / sivakumar sekharannair
You can use IEBCOMPR
Used to compare two sequential data sets, two partitioned data sets or two PDSEs at the logical record level to verify a backup copy. Fixed, Variable, or undefined records from blocked or unblocked data sets or members can also be compared. However, you should not use IEBCOMPR to compare load modules.
Is This Answer Correct ? | 1 Yes | 0 No |
//job331ab job notify=&sysuid
//step1 exec pgm=idcams
//sysprint dd sysout=*
//input dd dsn=job331ab.prasad.infile,disp=shr
//sysin dd*
print infile(input)count(1)
/*
if return code rc=00 then it is not empty file,
return code rc=04 then it is empty
Is This Answer Correct ? | 1 Yes | 0 No |
what is the difference between JES3 and JES2?
If Name is NOT given for a JOB statement, then will it give error or installation will supply it for the JOB ?
When The Define Jcl Is Not Available, How Can You Get Information About A Vsam File's Organisation ?
How to search strings in multiple dataset with conditions 'string1 & string2'?
What statement can be used to send data to another mvs jes3 node?
What is DYNAMBR in jcl?
What is the use of disp parameter?
What is a GDG? How is it referenced? How is it defined? What is a MODELDSCB?
How to see the COMP3 value(packd decimal)
what do you mean by include statement in jcl?
how to put a dependency on job in jcl using opc scheduler?
What is NOTCAT 2