View previous topic :: View next topic
|
Author |
Message |
Gops
New User
Joined: 21 Jul 2005 Posts: 23
|
|
|
|
Hi Guys,
I reading a A VSAM file in Online CICS program and has some quries about the same.
EXEC CICS
READ DATASET ('FILE1')
INTO (FILE-REC)
RIDFLD (FILE-ID)
RESP (WS-RESP)
END-EXEC.
EVALUATE WS-RESP
WHEN 0
THROUGH A ERROR SAYING THE KEY ALREADY EXISTS.
WHEN 13 --> NOT FOUND
WRITE THE FILE-REC IN THE FILE.
WHEN OTHER
ABEND THE TRANSACTION.
My question to u guys is,
What will the numeric value of WS-RESP, when the record NOT found in the VSAM file?
Is it 13 or 14 or some other value. Please confirm as in our installation we only chek the value of RESP not
DFHRESP (NORMAL) or DFHRESP (NOTFND).
Thanks,
Gops |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Gops wrote: |
Is it 13 or 14 or some other value. Please confirm as in our installation we only chek the value of RESP not
DFHRESP (NORMAL) or DFHRESP (NOTFND). |
Well, why can't you continue using DFHRESP (NORMAL) or DFHRESP (NOTFND)? |
|
Back to top |
|
|
Raphael Bacay
New User
Joined: 04 May 2007 Posts: 58 Location: Manila, Philippines
|
|
|
|
You can look it up VSAM return codes.
I think
www.theamericanprogrammer.com
has a list of return codes you can use to define NOTFND for VSAM.
You can even look up the other codes you might want to handle.
Regards. |
|
Back to top |
|
|
Gops
New User
Joined: 21 Jul 2005 Posts: 23
|
|
|
|
Hi Raphael / William,
Thnaks For your quick response.
Well, I can't use DFHRESP (NORMAL) or DFHRESP (NOTFND) because as per our installation coding standard we have do a check on the RESP only.
Raphael I had a look into the link you have given, I didn't get answer to my query.
Please give me more/exact details what wil the RESP value if the record not found in the VASM for CICS online program?
Thanks,
Gops |
|
Back to top |
|
|
rz061m
New User
Joined: 03 Mar 2006 Posts: 48 Location: Chennai
|
|
|
|
Hi,
You can check DFHRESP with the code you have posted earlier.
EVALUATE WS-RESP
WHEN DFHRESP (NORMAL)
THROUGH A ERROR SAYING THE KEY ALREADY EXISTS.
WHEN DFHRESP (NOTFND)
WRITE THE FILE-REC IN THE FILE
END-EVALUATE.
Thanks,
Karthik. P |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Gops wrote: |
Well, I can't use DFHRESP (NORMAL) or DFHRESP (NOTFND) because as per our installation coding standard we have do a check on the RESP only. |
What part of using DFHRESP (NORMAL) or DFHRESP (NOTFND) is not doing a "check on the RESP only"?
DFHRESP (NORMAL) is only synonym for a number...... |
|
Back to top |
|
|
Raphael Bacay
New User
Joined: 04 May 2007 Posts: 58 Location: Manila, Philippines
|
|
|
|
Sorry for my previous post.
I think it will be easy for you to find the numeric value for the Response Codes. Like DFHRESP(NORMAL) is equivalent to '00' for example. I looked up 'DFHRESP CODES' in Google and found out that these codes are actually CICS Response Codes. Maybe you can look them up again to find a complete list. I found the list but it is quite long to post. Maybe you can find it yourself. It is hard to miss.
Regards. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Raphael Bacay wrote: |
I think it will be easy for you to find the numeric value for the Response Codes. Like DFHRESP(NORMAL) is equivalent to '00' for example. |
But why would you want to use the numeric equivalents to the DFHRESP values, to do so opens your code to become obsolete if IBM ever changes anything.
Quote: |
I looked up 'DFHRESP CODES' in Google and found out that these codes are actually CICS Response Codes. Maybe you can look them up again to find a complete list. I found the list but it is quite long to post. Maybe you can find it yourself. It is hard to miss. |
They are also easily found in the Appendix describing the EIB in the CICS Application Programming Reference...... |
|
Back to top |
|
|
Gops
New User
Joined: 21 Jul 2005 Posts: 23
|
|
|
|
Hi Guys,
Thankyou all for your quick responses and for your interest.
Raphael / William thanks to both of you, its 13, I just wanted to confirm it once again.
Thanks,
Gops. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Gops wrote: |
Well, I can't use DFHRESP (NORMAL) or DFHRESP (NOTFND) because as per our installation coding standard we have do a check on the RESP only. |
I'm still asking, what part of using DFHRESP (NORMAL) or DFHRESP (NOTFND) is not doing a "check on the RESP only"? |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
and if IBM chages the values for NOTFND or others your program will not
function correctly any more. As stated you should being doing what I call
standard programming practice, which is to use the correct CICS usage
of check the RESP CODES.
DFHRESP(NORMAL), DFHRESP(NOTFND) ect....... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Some sites have "rules"/standards that can cause problems. . . .
This
Quote: |
Well, I can't use DFHRESP (NORMAL) or DFHRESP (NOTFND) because as per our installation coding standard we have do a check on the RESP only. |
is yet another one. . . .
Or maybe the actual standard is being currently interpreted this way. . As Bill asks, how is using a number more correct than using the alpha value? |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
Using the Alpha value, you at least know what condition you are
looking at, and not going and have to fine out the value assigned
to a number. The number has no meaning to me when looking at
them with out having the book opened a tracking down the alpha
function. |
|
Back to top |
|
|
|