View previous topic :: View next topic
|
Author |
Message |
Vineet
New User
Joined: 14 Sep 2005 Posts: 20
|
|
|
|
Hi All,
Want to know, is there any Utility which can tell that specific File (NON VSAM / VSAM) is EMPTY. I dont want to write any COBOL Pgm. I am looking for Utility.
Thanx
Rgds
Vinit A. |
|
Back to top |
|
|
Mfprogrammer
New User
Joined: 24 May 2006 Posts: 6
|
|
|
|
Hi Vineet,
You can use IDCAMS for the same.
In your SYSIN card, if you give
PRINT INFILE(ddname) CHARACTER COUNT(1)
it will return 4 if file is empty, else it will return 0.
Hope it helps. |
|
Back to top |
|
|
Hanfur
Active User
Joined: 21 Jun 2006 Posts: 104
|
|
|
|
Vineet,
You can try ICETOOL with EMPTY option for VSAM ; as given below..
//STEP1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...
//TOOLIN DD *
COUNT FROM(IN) EMPTY
/*
//DEC IF STEP1.RC = 0 THEN
//STEP2 EXEC ...
...
//DECE ENDIF
Here if the file is EMPTY RC would be 12 .By checking this you can decide wthether the subsequent steps needs to be executed or not.STEP2 above excuted only if the file have some data in it.
-Han. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
|