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

what is the difference between JES3 and JES2?

0 Answers  


If Name is NOT given for a JOB statement, then will it give error or installation will supply it for the JOB ?

1 Answers   IBM,


When The Define Jcl Is Not Available, How Can You Get Information About A Vsam File's Organisation ?

0 Answers   IBM,


How to search strings in multiple dataset with conditions 'string1 & string2'?

1 Answers   IBM,


What statement can be used to send data to another mvs jes3 node?

0 Answers  






What is DYNAMBR in jcl?

2 Answers   CTS,


What is the use of disp parameter?

0 Answers  


What is a GDG? How is it referenced? How is it defined? What is a MODELDSCB?

3 Answers  


How to see the COMP3 value(packd decimal)

2 Answers   iGate,


what do you mean by include statement in jcl?

1 Answers   IBM,


how to put a dependency on job in jcl using opc scheduler?

1 Answers   CTC,


What is NOTCAT 2

2 Answers   IBM,


Categories