Avoid abend when VSAM is empty.

JES2/3, JCL, utilities.
Post Reply
MayankG
New Member
Posts: 1
Joined: Thu Dec 04, 2014 4:35 pm

Avoid abend when VSAM is empty.

Post by MayankG »

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 ?
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Avoid abend when VSAM is empty.

Post by nicc »

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
zprogrammer
Global Moderator
Global Moderator
Posts: 588
Joined: Wed Nov 20, 2013 11:53 am
Location: Mars

Re: Avoid abend when VSAM is empty.

Post by zprogrammer »

Just to add on to what NicC said , Do you need to copy when the dataset is empty?
zprogrammer
User avatar
mickeydusaor
Forum Moderator
Forum Moderator
Posts: 27
Joined: Fri Aug 28, 2015 10:11 pm
Location: Salem, Oregon

Re: Avoid abend when VSAM is empty.

Post by mickeydusaor »

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.
Post Reply

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

Register

Sign in

Return to “JCL - Job Control Language.”