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

in jcl you are having JCLLIB and STEPLIB what happens

10 Answers   EDS, Wipro,


How do you submit JCL via a Cobol program?

2 Answers   Cap Gemini,


How to execute 300 steps in a Job?

15 Answers   Accenture, Zensar,


Explain the function of a dd statement?

0 Answers  


how to modify the copy book?explain with examples

2 Answers   TCS,






Can we able insert data into a PS file Using IEBUPDTE utility??? If Yes can anyone describe it please..

1 Answers  


Hi, can any one tell about " How do u eliminate the duplicates "

2 Answers   Cap Gemini,


can we have more than one job in a single job card that is we are specifying only one 'job' statement in the jcl.

7 Answers   Accenture,


What is difference between Return Code, user completion code, Abend code and reason Code?

2 Answers   IBM, Satyam, Wipro,


I want to JCL sort for Non-COMP and COMP-3 fields SORT FIELDS=(1,5,A,6,11,A,12,11,A,19,1,A,20,1,A),FORMAT=BI,EQUALS Length of comp bytes is 11 bytes which start at 6byte and 12 byte considering 11 bytes in comp-3 is 6 bytes. Can anyone tell if the above sort work SORT FIELDS=(1,5,A,6,6,A,12,6,A,19,1,A,20,1,A),FORMAT=BI,EQUALS does not works OK

0 Answers   IBM,


I want my job (careerride) to be executed in 1 minute and 2 seconds. How do I do that?

0 Answers  


What are the common jcl syntax errors you get? This is not abends?

1 Answers  


Categories