MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Handling VSAM file thru Assembler code

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
Ganesh_999
Beginner


Joined: 12 Aug 2003
Posts: 3
Topics: 1

PostPosted: Tue Aug 12, 2003 2:17 am    Post subject: Handling VSAM file thru Assembler code Reply with quote

I am trying to use SHOWCB to display the error codes for a VSAM file.

I am reading an empty VSAM file. OPEN macros fails and R15 contains X'08'. I want to have a reason code by using SHOWCB macros.

Can anybody tell me how I can distinguish between simple open error and 'empty file' open error ?

Thanks,
Ganesh
Back to top
View user's profile Send private message
RonB
Beginner


Joined: 02 Dec 2002
Posts: 93
Topics: 0
Location: Orlando, FL

PostPosted: Tue Aug 12, 2003 1:46 pm    Post subject: Reply with quote

No, but I can tell you how to obtain the Reason Code. After returning from the OPEN with an RC=8 in R15, do the following:
Code:

           CVD     R15,DPACK8            CONVERT RC TO 8-BYTE PACKED FIELD
           UNPK    RETURN8,DPACK8+4(4)   UNPACK RC TO 8-BYTE ZONED FIELD
           OI      RETURN8+7,X'F0'       RESET ZONE BITS FOR DISPLAY
           XC      VSAMRC4,VSAMRC4       CLEAR VSAM REASON CODE
           SHOWCB  RPL=SYSRPL,AREA=VSAMRC4,LENGTH=4,FIELDS=(FDBK)
           L       R15,VSAMRC4           R15  = VSAM REASON CODE
           CVD     R15,DPACK8            CONVERT RC TO 8-BYTE PACKED FIELD
           UNPK    REASON8,DPACK8+4(4)   UNPACK RC TO 8-BYTE ZONED FIELD
           OI      REASON8+7,X'F0'       RESET ZONE BITS FOR DISPLAY


HTH...

Ron
_________________
A computer once beat me at chess, but it was no match for me at kick boxing.
Back to top
View user's profile Send private message
Ganesh_999
Beginner


Joined: 12 Aug 2003
Posts: 3
Topics: 1

PostPosted: Thu Aug 14, 2003 1:57 am    Post subject: Reply with quote

Hi Ron,
Thanks..But I don't understand why you are moving the return code from R15 to RETURN8 field before issuing a call to SHOWCB ? I gues it won't be used by SHOWCB.
I tried this , But reason code is not returned in VSAMRC4 field ?

Regards,
Ganesh
Back to top
View user's profile Send private message
RonB
Beginner


Joined: 02 Dec 2002
Posts: 93
Topics: 0
Location: Orlando, FL

PostPosted: Thu Aug 14, 2003 7:35 am    Post subject: Reply with quote

I'm moving the return code from R15 to RETURN8 field before doing a SHOWCB so that I can "display" the VSAM Return Code as well as the VSAM Reason Code. After the SHOWCB etc., I "display" both the Return Code AND the Reason Code.
It is my experience, though, that the situation you describe ( empty VSAM kSDS being opened for Input ) results in a Return Code of 8, and a Reason Code of zero. I don't know WHY the Reason Code is zero, but it is.

Ron
_________________
A computer once beat me at chess, but it was no match for me at kick boxing.
Back to top
View user's profile Send private message
Ganesh_999
Beginner


Joined: 12 Aug 2003
Posts: 3
Topics: 1

PostPosted: Mon Aug 18, 2003 6:37 am    Post subject: Reply with quote

Hi Ron,
You are right if Return code is 8(empty VSAM KSDS being opened for Input), Reason code is zero!
In my case I found a way. The file I am opening contains a NULL record always as the first record.
I open it and if there is an OPEN error (R15 = 8), I use SHOWCB to get the count of the records in the file. If it is not greater or equal to 1, then it means it is an empty file error.
And if its non-empty OPEN error, than SHOWCB itself fails to give the record count.

Thanks a lot for your help,
Ganesh
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group