Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To Check whether a VSAM file is empty or not

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
arunjakhar

New User


Joined: 09 Jan 2007
Posts: 1
Location: mumbai

PostPosted: Tue Jan 09, 2007 11:20 am    Post subject: To Check whether a VSAM file is empty or not
Reply with quote

Hi
Could anyone tell me how to check whether a particular VSAM file is empty or not?
We can do this using IDCAMS - PRINT but is there any other way to do so which gives return code less than 8. Just provide some sample code also if possible.

Thanks
Arun
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Jan 09, 2007 11:41 am    Post subject:
Reply with quote

HI There,

You can use dfsort for this

Code:
//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//TOOLIN DD *
COUNT FROM(IN) EMPTY RC4
/*


This will give a return code of 4 if the file is empty ,
Back to top
View user's profile Send private message
prafull

New User


Joined: 08 Dec 2006
Posts: 48

PostPosted: Tue Jan 09, 2007 7:04 pm    Post subject: Re: To Check whether a VSAM file is empty or not
Reply with quote

if u repro the VSAM dataset to any dataset or dummy dataset ,
it wil give VSAM return code 160 -indicating Input VSAM file is empty

//STST50 EXEC PGM=IDCAMS,COND=(0,NE)
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *
REPRO -
INFILE(INPUT) -
OUTFILE(OUTPUT)
/*
//INPUT DD DSN=...........
//OUTPUT DD DUMMY
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Tue Jan 09, 2007 7:10 pm    Post subject:
Reply with quote

And there is also LISTCAT in IDCAMS.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts Underlying DB2 VSAM LDS - SMF recording vasanthz All Other Mainframe Topics 6 Thu Jan 05, 2017 4:20 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us