Page 1 of 1

What to do after an error input / output VSAM?

PostPosted: Fri Apr 15, 2011 12:13 am
by michel123
Hello,

For example, after an OPEN and a test SHOWCB by giving an error, we must stop the program and indicate the problem.

Example:
OPEN ESDSFILE

LTR R15,R15
BNZ BADOPCL

BADOPCL DS 0H
ST R15,SAVR15 SAVE R15 FOR LATER DISPLAY
*
SHOWCB ACB=ESDSFILE, X
AREA=RETCODE, X
LENGTH=4, X
FIELDS=ERROR

LTR R15,R15
BNZ ERROR

what to put in my paragraph ERROR?


Is there a particular macro to do this?



Thanks.

Re: What to do after an error input / output VSAM?

PostPosted: Fri Apr 15, 2011 12:33 am
by steve-myers
Well, to start with you cannot use ERROR as both a data area and the target of a conditonal branch.

Re: What to do after an error input / output VSAM?

PostPosted: Fri Apr 15, 2011 12:34 am
by enrico-sorichetti
error is just a label in Your program,
You are free to do anything You like/feel useful to provide to the user.
You might probably want to display the return code and the reason code and exit nicely with a 16 RC

Re: What to do after an error input / output VSAM?

PostPosted: Thu Apr 21, 2011 12:19 pm
by Schubie
Most likely you could (A) ABEND the program or (B) set a non-zero RETURN CODE and terminate the program

Re: What to do after an error input / output VSAM?

PostPosted: Thu Apr 21, 2011 12:39 pm
by steve-myers
Schubie wrote:Most likely you could (A) ABEND the program or (B) set a non-zero RETURN CODE and terminate the program

I think michel123 is looking for something like the SYNADAF macro for non-VSAM. It's possible that the "VSAMFAIL" routine, described here, might be able to do what he wants, but I've never used it, so I can't vouch for it. Unlike the "DAIRFAIL" routine, it does not appear to have an option to return its error message in a buffer, which limits its utility.

When I said I've never used it, I was not telling the whole truth. I used it once, for a TSO related capability of the program, but I was unhappy with its output and never tried it again.

Re: What to do after an error input / output VSAM?

PostPosted: Fri Nov 11, 2011 1:15 am
by BillW
Isn't there a dump macro to dump sections of your program/storage? You could then preface each area with something like:

DS 0D
BEGACB DC CL8"ACB>>>>>"
MYACB ACB whatever
ENDACB DC CL8"<<ENDACB"

You could do the same for RPL or any area you would like to see.