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

To Check whether a VSAM file is empty or not


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 1208
Location: Bangalore,India

PostPosted: Tue Jan 09, 2007 11:41 am
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
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: 1104
Location: The Netherlands at Hole 19

PostPosted: Tue Jan 09, 2007 7:10 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top