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 |
Explain the function of the steplib dd statement?
What parameters can be used to limit the number of records written to a sysout dataset?
Which statement is used to identify the private libraries in job?
1.How to check for the errors using TYPRUN=SCAN?What will be the output if we give TYPRUN=SCAN?
Explain about LMFREE�free data set from its association with data ID
What does it mean by Restart and Checkpoint in JCL ? How are checkpoints being taken and what is their usage ? How to use Checkpoint macro on a JOBSTEP ?
if in a job, region is mentioned in both jobcard and in step then which is cosidered at the step level? A job has region 4k in jobcard and step1 with region 0k and step2 with 16k, then what is the region allocated for the entire job? what is the region step1 takes? what is the region step2 takes?
How to alter the parameters for the existing gdg?
How to Enter The Spool Area In Real Time?
Can a job have only steplib and no joblib ?
if we want to use a gdg which is already created by some job, then how to use the reference of the last generation in a jcl?
IN DFSORT sum fields=none is usec to remove duplicates.how to write the duplicates in another dataset?