|
|
| Author |
Message |
lekshmi_ci
Active User
Joined: 14 Mar 2007 Posts: 57 Location: Thiruvananthapuram
|
|
|
|
| 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 |
|
 |
References
|
Posted: Wed May 14, 2008 6:03 pm Post subject: Re: VSAM file empty check |
 |
|
|
 |
Moved: Wed May 14, 2008 6:07 pm by superk From JCL to DFSORT/ICETOOL |
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1480
|
|
|
|
| Please provide us with some JCL, error msgs, etc. Hurry up, this is urgent! |
|
| Back to top |
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 3096 Location: Charlotte,NC USA
|
|
|
|
| The method posted here is the typical method used. |
|
| Back to top |
|
 |
lekshmi_ci
Active User
Joined: 14 Mar 2007 Posts: 57 Location: Thiruvananthapuram
|
|
|
|
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  |
|
| Back to top |
|
 |
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 1142 Location: At my desk
|
|
|
|
| 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  |
Please post your sysins and sysouts...... |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4228 Location: San Jose, CA
|
|
|
|
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 |
|
 |
|
|