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 release the Output HELD by using HOLD = YES on DD statement ?
Explain about LMCOPY -
Can we call instream to catalog and catalog to instream?
what is SOC4 error?
how to override PROC? please give answer in details. Please mention how to write it in JCL. Thanks in advance.
Can comments be specified at the very beginning of a jobcard? Will the JCL execute?
How do you submit a JCL under CICS environment ?
If i am going to change some variable in a copybook( size or variable type) ,what are the changes that need to be done in the corresponding JCL.
how to resolve the soc4 error?
What is GDG?
When we give TYPERUN = SCAN , what are the syntax errors we get?
i have a file which contains duplicates ? my requirement is to eliminate duplicates and these elminated duplicates should be moved to another file can any code this using sort ?