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 |
How to fetch even records from one file to another file by using ICETOOL in JCL?
how to execute the last 5 steps in jcl
What is the job entry system used in your project? based on what criteria the sequence of jobs are picked if priority is not mentioned in the job card?
what do you mean By spooling? Expand SPOOL?
How can the submitting users racf authority be overridden in a job stream?
how can u identify the db2 from jcl ?
How does -818 sql error occur? Why does it happen and what can be done to overcome this error code?
Explain how can a jobs execution priority be modified?
Which statement is used to identify the private libraries in job?
A maximum of 100 chars can be passed to Cobol through Parm in JCL, If we want to pass more than 100 Chars how we can do it ?
Why do you want to specify the REGION parameter in a JCL step?
Explain the function of //jcllib statement?