How to identify where file is empty or not? How many ways are
there to identifying?

Answers were Sorted based on User's Feedback



How to identify where file is empty or not? How many ways are there to identifying?..

Answer / bala

1) Use IDCAMS
SYSIN DD *
PRINT INDATASET(file name) COUNT(1)
gives RC 04 if the file is an empty file.

2)Compare the file with a known empty file using IEBCOMPR
utility. Comparing two empty files gives Nonzero RC

Is This Answer Correct ?    6 Yes 1 No

How to identify where file is empty or not? How many ways are there to identifying?..

Answer / swapnilkumar

There are two ways to check for the file empty or not.
1) With FILEAID
2) With IEBPTPCH

//STEPXX EXEC PGM=FILEAID
//DD01 DD DSN=P1.SEQUEN.INPUT.FILE,DISP=SHR
//DD01O DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD DUMMY
other is

//STEPXX EXEC PGM=IEBPTPCH
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=P1.SEQUEN.INPUT.FILE,DISP=SHR
//SYSUT2 DD DUMMY
//SYSIN DD DSN=SYS1.CTLLIB(P1CTL),DISP=SHR

where CTL card has
PRINT TYPORG=PS,CNTRL=1

The either of above step gets RC=04 then the file is empty
else if its zero then file has some data in it.

Is This Answer Correct ?    5 Yes 2 No

How to identify where file is empty or not? How many ways are there to identifying?..

Answer / fred

There are so many ways this can be done.

DFSORT/SYNCSORT
ICETOOL/SYNCTOOL
IDCAMS
FILEAID/FILEMANAGER
IEBPTPCH
ISRSUPC
EASYTRIEVE
Using REXX checking with EXECIO / LISTDSI



Using SORT is the easiest:

//jobcard

//S010 EXEC PGM=SORT,PARM='NULLOUT=RC4'
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=<datasetname>
//SORTOUT DD DUMMY
//SYSIN DD *
SORT FIELDS=COPY
/*


-- RC 4 if Empty
RC 0 if there is data.

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More JCL Interview Questions

Step 1 RC 4 Step 2 Step 3 I want to know the COND parameter which can be coded in step 2 or 3. Step 2 should be executed based on Step 1 RC and Step 3 should not be executed based on step 1's RC

0 Answers  


What is the difference b/w the CLASS,TIME,PRTY in jcl job card.

4 Answers   Syntel,


how can we override data definitions in jcl. can any one give detailed example

3 Answers   TCS,


i) Difference between ps, esds, ii) Difference between lrecl, blksize among PS, PDS issues? i.e in jcl at dcb

2 Answers  


Explain about File Tailoring

1 Answers  






How do you access an uncatalogued dataset in a jcl?

0 Answers  


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  


if my GDG limit has been kept as 50 and if am trying to put 60 records.what would happen. will there be any abend for this scenario

4 Answers  


what is the cond=even only

4 Answers   EDS,


when can a job time-out occur? How to overcome that?

0 Answers   IBM,


What is DYNAMBR in jcl?

2 Answers   CTS,


What are the basic JCL Statements for a Job?

1 Answers  


Categories