How to identify where file is empty or not? How many ways are
there to identifying?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
What is the differentiation between TRK,cyl, and Bytes... how they can be connected??
what is a MODELDSCB?
Suppose I have a program in cobol name ”careerride” and want to execute the program by jcl. Specify the process?
How do you check the syntax of a JCL without running it?
What statement marks the beginning of an in-stream or cataloged procedure in jcl and assigns default values to parameters defined in the procedure?
how to concatenate datasets
shall we concordinate two different length dataset in to a new date set.
If we have 100 job steps in JCL and we want to excute steps only starting from 43 to 50, then how it can be coded in JCL/
We are using 2 files , file one has data, file two is empty.Using jcl how can we find the other file is empty?
how many max steps can we use in a job? pls answer to my question
01 GROSS-PAY 05 BASIC-PAY PIC 9(5) 05 ALLOWENCES PIC 9(3) if BASIC-PAY has a value 1000 and ALLOWENCES has a value of 250,what will be displayed by the statement DISPLAY GROSS-PAY a.1250 b.01000250 c.01250 d.1.250
what do you mean By spooling? Expand SPOOL?