How to check empty file in jcl?

Answers were Sorted based on User's Feedback



How to check empty file in jcl?..

Answer / muttaiah

There are so many utilities(ICetool, IDcams, Iebgener)
which we can make use to check whether a file is empty.

//Jobcard
//stepname exec pgm=idcams
//dd1 dd dsn=xxx.pds,disp=shr
//sysin dd *
print infile(dd1) count(1)
/*

Here the job will give a return code '0' if the file has
atleast 1 record and RC-4 if there are no records

Suppose you want to check whether any records are there
apart from header and trailer. then Make the count as Count
(3).

//sysin dd *
print infile(dd1) count(3)
/*

Is This Answer Correct ?    16 Yes 0 No

How to check empty file in jcl?..

Answer / sravani

using iebptpch

Is This Answer Correct ?    2 Yes 0 No

How to check empty file in jcl?..

Answer / arun sundar j

It can also be possible by using SPEMPTY

Is This Answer Correct ?    2 Yes 1 No

How to check empty file in jcl?..

Answer / pradeep k (cr)

Thanks all for ur valuable answers, but i have one small
doubt.
I tried with ICETOOL, by giving empty input file and i am
able to sumit job with maxcc 000 and outptu is comming fine
as total recard count as 0.

in same way, i am trying to submit jcl provided by Muttaiah
but i am getting jcl error message like 'ILLEGAL KEYWORD
INT RINT' at the place of PRINT statement.

Can anyone suggest me, what's my mistake?

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JCL Interview Questions

Is it possiable to use a gdg in the INCLUDE statement in a SORT jcl? I am using this because I want to change the condition with out changing the jcl. Please provide with a sample code.

1 Answers  


Explain the hierarchy levels in jcl?

0 Answers  


what is the alternative to model parameter?

0 Answers  


What is the purpose and meaning of the REGION keyword and what JCL statement is it associated with?

3 Answers   IBM,


Is CPU time (TIME parameter) assigned to a JOB and JOBSTEP BOTH, by default ?

6 Answers   IBM,






If a field is declared as a comp-3 field and if we want to sort a dataset based on this field, then how will the sort card be??? e.g- if we want to sort by a field which is defined as a PIC X(5) then we will mention - sort fields=(1,5,ch,a). Likewise if a field is defined as PIC S9(10)COMP-3 then in this case how will the sort field be defined (because in this case a sign is also involved)???

8 Answers  


Explain concatenating datasets?

2 Answers   CTS,


with out sorting how to copy records from one file to another file using jcl.Mean I have one input file in which the record are like 1,6,5,4,2,3(for example) and i want to copy to output file from top to bottom(without sorting) like 3,2,4,5,6,1.so I want the JCL for this.cna any one can answers?

1 Answers   TCS,


How to pass data to a program that is coded in an exec statement?

0 Answers  


I found in one of the jcl, gdg version being mentioned as : abc.def.ghi(-0) Can anyone tell me how referring the version as (-0) is different from referring it as (0)

2 Answers  


if we want to use a gdg which is already created by some job, then how to use the reference of the last generation in a jcl?

0 Answers   IBM,


What is Cataloged Procedures?

0 Answers  


Categories