Hi,
In one of my Jobs, one step copy a VSAM data set to flat file. Later the flat file is processed. Sometime the input VSAM is empty. When its empty, the job abends. How can I prevent the job from abending when the VSAM is empty ?
Avoid abend when VSAM is empty.
Re: Avoid abend when VSAM is empty.
Why is the file empty? Is it deleted and recreated every day and then used to collect possible input? If so, you need to insert and then delete a dummy record when creating the dataset. You cannot read a VSAM dataset that has never had data in it.
Regards
Nic
Nic
-
- Global Moderator
- Posts: 588
- Joined: Wed Nov 20, 2013 11:53 am
- Location: Mars
Re: Avoid abend when VSAM is empty.
Just to add on to what NicC said , Do you need to copy when the dataset is empty?
zprogrammer
- mickeydusaor
- Forum Moderator
- Posts: 27
- Joined: Fri Aug 28, 2015 10:11 pm
- Location: Salem, Oregon
Re: Avoid abend when VSAM is empty.
Code: Select all
//step0001 EXEC PGM=IDCAMS
//INFILE DD DSN=XXX.YYY.ZZZ,DISP=SHR
//SYSIN DD *
PRINT INFILE(INFILE) COUNT(1)
//*
// if step0001.rc eq 0
//step0099 exec pgm=xxxxxxx
// endif
Last edited by Anuj Dhawan on Fri Sep 11, 2015 8:26 am, edited 2 times in total.
Reason: Added code tags.
Reason: Added code tags.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute