IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Utility To Find out Fileis Empty or Not.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vineet

New User


Joined: 14 Sep 2005
Posts: 20

PostPosted: Wed Jul 12, 2006 11:39 am
Reply with quote

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
View user's profile Send private message
Mfprogrammer

New User


Joined: 24 May 2006
Posts: 6

PostPosted: Wed Jul 12, 2006 12:07 pm
Reply with quote

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
View user's profile Send private message
Hanfur

Active User


Joined: 21 Jun 2006
Posts: 104

PostPosted: Wed Jul 12, 2006 12:13 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jul 12, 2006 8:24 pm
Reply with quote

For more information on using DFSORT's ICETOOL for this kind of thing, see:

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmst03.html#t10
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts REASON 00D70014 in load utility DB2 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts Insert trailer for non empty file only DFSORT/ICETOOL 6
Search our Forums:

Back to Top