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 find the UNIT and VOLUME of a (a) KEPT (b) UNCATALOGED and (c) CATALOGED dataset - using (i) JCL and using (ii) ISPF ?
what disp parameter we mention for creation of temporary dataset so that we can use it in later steps?
Can a PROC CALL another PROC ? (in both Instream and Cataloged cases) ?
A file has dta in S9(09) COMP format. How do I move the data into a character field X(10)?
In JCL..for TIME Parameter was specified both JOB & STEP..which one is overrides
i have five step in jcl.my forth step is gdg.gdg was abend.when will job complete,hoe to handle you
Matching Logic in Jcl not in cobol.Could any one please answer this question
How to point my proc to production dataset always though i keep jcllib order=development.dataset? Is it possible?
Explain about LMPUT-
what is the difference between JES3 and JES2?
in order to execute step2 a job after a return code of 8 in step1, what condition you will code in step2?
What is the difference between the JOBLIB and the STEPLIB statements?