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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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