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 can u understand ps and pds from their names ?
I have two input SORTIN files and We need to create one SORTOUT file which contains data of both input files. What is the SortCard for this?. Suppose the length of the both files are different, then How we do it? Please reply ASAP
COND -> step1 . . step2, Step2, Executes if the CC of step1 is 0. But even if it is NOT 0 and if we dont give COND, will step2 be executed ?
How to execute step2,step5,step7 of a proc of 10 steps? You are not allowed to change in JCL.
Name the parameters which can be used to limit the number of records written to a sysout dataset?
What do you do if you do not want to keep all the space allocated to a dataset?
what do you mean By spooling? Expand SPOOL?
i want to see the jobs in skeleton queue in diff region. (eg. 7 regions are running means , i want to see all the jobs in 7 regions which are in skel queue using 1 command)
what r the types of job control statements?
Name the system library from which modules are retrieved at execution
What is the error in the following JCL statements : I) //step#three exec pgm=hkbc762 ii) //step#3 exec pgm = hkbc762 iii) //step#3 exec pgr = hkbc672
What is the difference between static call & Dynamic call ?