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 to find the UNIT and VOLUME of a (a) KEPT (b) UNCATALOGED and (c) CATALOGED dataset - using (i) JCL and using (ii) ISPF ?

0 Answers   IBM,


what disp parameter we mention for creation of temporary dataset so that we can use it in later steps?

0 Answers   IBM,


Can a PROC CALL another PROC ? (in both Instream and Cataloged cases) ?

3 Answers   IBM,


A file has dta in S9(09) COMP format. How do I move the data into a character field X(10)?

2 Answers  


In JCL..for TIME Parameter was specified both JOB & STEP..which one is overrides

6 Answers   Satyam,






i have five step in jcl.my forth step is gdg.gdg was abend.when will job complete,hoe to handle you

3 Answers   L&T, Wipro,


Matching Logic in Jcl not in cobol.Could any one please answer this question

0 Answers  


How to point my proc to production dataset always though i keep jcllib order=development.dataset? Is it possible?

3 Answers  


Explain about LMPUT-

1 Answers  


what is the difference between JES3 and JES2?

0 Answers  


in order to execute step2 a job after a return code of 8 in step1, what condition you will code in step2?

0 Answers   IBM,


What is the difference between the JOBLIB and the STEPLIB statements?

3 Answers  


Categories