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 |
wht r different types of sort fields in jcl ?
Which is the most widely used batch performance monitor for DB2?
What is the purpose of dd * statement in jcl?
Is acct parameter mandatory?
Can we use empty VSAM as input?
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?
My requirement is : How to populate a empty PS/flat file with ONLY spaces in the first line. You should not use any input dataset to do this. I'm not sure whether you may use any utility for this purpose?
I am getting the file from Unix to Mainframes for every 15 minutes. The mainframe job get abended with bad records coming from unix. I recovered that by deleting the bad data. I need permenant solution how to fix the issue? The record is getting characters in in first 9 positions which it should not. Please provide me the solution how to skip the records if it finds the charcters in the first 9 positions. K
What parameters can be used to limit the number of records written to a sysout dataset?
How do you submit a JCL under CICS environment ?
List in order the hierarchical levels of jcl?
What do you understand by the term job time – out and how can you overcome that?