Page 1 of 1

Avoid abend when VSAM is empty.

Posted: Thu Sep 03, 2015 3:38 pm
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 ?

Re: Avoid abend when VSAM is empty.

Posted: Thu Sep 03, 2015 5:09 pm
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.

Re: Avoid abend when VSAM is empty.

Posted: Sat Sep 05, 2015 5:23 pm
by zprogrammer
Just to add on to what NicC said , Do you need to copy when the dataset is empty?

Re: Avoid abend when VSAM is empty.

Posted: Fri Sep 11, 2015 2:05 am
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