Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
VSAM file empty check

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
lekshmi_ci

New User


Joined: 14 Mar 2007
Posts: 60
Location: Thiruvananthapuram

PostPosted: Wed May 14, 2008 6:03 pm    Post subject: VSAM file empty check
Reply with quote

I want to check whether a VSAM file is empty or not. Depending on the successful execution of that step I need to continue with the below steps.
Back to top
View user's profile Send private message

mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed May 14, 2008 6:10 pm    Post subject:
Reply with quote

Please provide us with some JCL, error msgs, etc. Hurry up, this is urgent!
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Wed May 14, 2008 6:10 pm    Post subject: Reply to: VSAM file empty check
Reply with quote

The method posted here is the typical method used.
Back to top
View user's profile Send private message
lekshmi_ci

New User


Joined: 14 Mar 2007
Posts: 60
Location: Thiruvananthapuram

PostPosted: Wed May 14, 2008 6:13 pm    Post subject: Reply to: VSAM file empty check
Reply with quote

PRINT INFILE(input) -
CHARACTER COUNT(1)
I used the above to check for empty file.
But since the file is empty it is getting error code 160 icon_sad.gif
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed May 14, 2008 6:36 pm    Post subject: Re: Reply to: VSAM file empty check
Reply with quote

lekshmi_ci wrote:
PRINT INFILE(input) -
CHARACTER COUNT(1)
I used the above to check for empty file.
But since the file is empty it is getting error code 160 icon_sad.gif
Please post your sysins and sysouts......
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Wed May 14, 2008 8:59 pm    Post subject:
Reply with quote

lekshmi_ci,

If you want a DFSORT solution rather than an IDCAMS solution (after all you did post in the DFSORT Fourm), you can use the technique described in the "Set RC=12 or RC=4 if file is empty, has more than n records, etc" Smart DFSORT Trick at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/

However, you'll probably need to modify the job slightly like this to allow DFSORT to accept an empty VSAM data set:

Code:

//STEP1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  VSAM data set
//TOOLIN DD *
* SET RC=12 IF THE 'IN' DATA SET IS EMPTY, OR
* SET RC=0 IF THE 'IN' DATA SET IS NOT EMPTY
COUNT FROM(IN) EMPTY USING(CTL1)
/*
//CTL1CNTL DD *
   OPTION VSAMEMT
/*


I suspect the IDCAMS job is NOT accepting the empty VSAM data set.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us