How to identify in JCL that an input file is empty without
reading it?

Answers were Sorted based on User's Feedback



How to identify in JCL that an input file is empty without reading it?..

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

How to identify in JCL that an input file is empty without reading it?..

Answer / gajendra

We can also Fileaid for the same

Is This Answer Correct ?    4 Yes 2 No

How to identify in JCL that an input file is empty without reading it?..

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

How to identify in JCL that an input file is empty without reading it?..

Answer / jeeva225

//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

Post New Answer

More JCL Interview Questions

how can u understand ps and pds from their names ?

1 Answers   TCS,


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

4 Answers   CSC,


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 ?

4 Answers   IBM,


How to execute step2,step5,step7 of a proc of 10 steps? You are not allowed to change in JCL.

3 Answers   IBM,


Name the parameters which can be used to limit the number of records written to a sysout dataset?

0 Answers  






What do you do if you do not want to keep all the space allocated to a dataset?

2 Answers  


what do you mean By spooling? Expand SPOOL?

4 Answers  


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)

1 Answers  


what r the types of job control statements?

2 Answers  


Name the system library from which modules are retrieved at execution

2 Answers  


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

6 Answers  


What is the difference between static call & Dynamic call ?

3 Answers  


Categories