View previous topic :: View next topic
|
Author |
Message |
vmj
New User
Joined: 16 May 2006 Posts: 16 Location: Philippines
|
|
|
|
What are the possible cause for this?
I'm not getting this when supplementing a key that is within the range of possible keys. But when supplementing it with a key that is possibly too large/high, I'm getting a NOTFND response.
I'm using a KSDS VSAM file.
An example is this:
possible key of the last record is 955624
i inquire key 546821 which is not in the file, the program just inform me that the key is not found in the file.
i inquire key 999999 which is also not in the file, the program gave me NOTFND response at STARTBR, so the succeeding READNEXT return INVREQ response.
if this is the case, what would you suggest? create a dummy record that would contain a 999999 key? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Why do you want to read past the the last record? |
|
Back to top |
|
|
vmj
New User
Joined: 16 May 2006 Posts: 16 Location: Philippines
|
|
|
|
William Thompson wrote: |
Why do you want to read past the the last record? |
Hi William,
It's actually a possible scenario when a user unknowingly supplied a key which is past the last record and it happened on the user's testing, i guess i just have to trap the NOTFND response code at STARTBR.
thanks! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
I would think that the code should be prepared "to trap the NOTFND response code at STARTBR" all of the time. . . . Is there some reason you would prefer prodution problems rather than a controlled, graceful message to the user (or in a batch job)? |
|
Back to top |
|
|
sangiah
New User
Joined: 10 Jun 2005 Posts: 62
|
|
|
|
Hello,
You Should create a Header Record with Key as Zeros and Trailer Record with KEY as HIGH VALUES usually 999999 to avoid STARTBROWSE notfnd condition.
Thanks. |
|
Back to top |
|
|
vmj
New User
Joined: 16 May 2006 Posts: 16 Location: Philippines
|
|
|
|
dick scherrer wrote: |
Hello,
I would think that the code should be prepared "to trap the NOTFND response code at STARTBR" all of the time. . . . Is there some reason you would prefer prodution problems rather than a controlled, graceful message to the user (or in a batch job)? |
yes you are right, and i have not anticipated that before. good thing it came out at the testing. I'm now coding the necessary changes to the program to trap it.
a lesson learned, thanks. |
|
Back to top |
|
|
vmj
New User
Joined: 16 May 2006 Posts: 16 Location: Philippines
|
|
|
|
sangiah wrote: |
Hello,
You Should create a Header Record with Key as Zeros and Trailer Record with KEY as HIGH VALUES usually 999999 to avoid STARTBROWSE notfnd condition.
Thanks. |
i guess this could also work, but you still have to code something on your program to disregard the default lowest and highest record.
i think the best thing to do is just trap the NOTFND response.
thanks everyone, nice discussion. |
|
Back to top |
|
|
Shanthi Jayaraman
New User
Joined: 11 Jun 2007 Posts: 26 Location: Malaysia
|
|
|
|
Hi All,
Need some help here. Similar situation like above but I do not have the opportunity to create the trailer record in the VSAM file.
My situation is :
000
A00
A01
A02
A0N
B00
B01
B02
B0N
I need to display in reverse way and I only know partial key values. What I am doing is Move High-Values to Key, Assign the partial key, STARTBR with GTEQ, READNEXT, READPREV and READPREV until the partial key changes in a loop. This works fine until while testing, I gave the key as B. B0N is the last record in the file
STARTBR - RESP 13, RESP2 80
READNEXT - RESP 16, RESP2 34
READPREV - RESP 16, RESP2 41
What I understand is EOF is reach but how do I handle this situation, I still need to display it as :
BN
B2
B1
I tried putting HANDLE CONDITION with NOTFND and perform a routine. But am not sure what I need to code there where it will be displaying the above.
Thank you for your input. |
|
Back to top |
|
|
lokesh ranjan
New User
Joined: 29 Jul 2005 Posts: 9 Location: Gurgaon
|
|
|
|
Hi,
You will not able to do this until you put a trailer record in the file. If your design doesn't allow to put trailer record then you will have to start reading it from start till you get the end-of-file condition in (READNEXT statement in loop after STARTBR).
Moving high values and doing STARTBR will give record-not-found. End-of-file condition is not permissible in STARTBR command. |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
Don't know what release level of CICS you are , but
this works in CICS/TS 3.1 - z/OS
MOVE HIGH-VALUES TO WS-RECKEY
EXEC CICS STARTBR RIDFLD(WS-RECKEY)
EXEC CICS READPREV RIDFLD(WS-RECKEY)
This should position you to last record in the file |
|
Back to top |
|
|
Shanthi Jayaraman
New User
Joined: 11 Jun 2007 Posts: 26 Location: Malaysia
|
|
|
|
Hi All,
I did a workaround on this - it works but it doesn't look good.
I have another handle for not recfnd where I will be moving low-values, startbr with gteq, move next in a loop until partial key chg or eof encountered. This will position me at the last rec. From there I do a read prev in a loop again until partial key chg.
Why I say its not good, if there are 100 records with that partial key, then it will go all the way to the last record and again climb up. I can only console myself by telling how much is the possibility / percentage of the user who need to look for the last key in the file.
As for the CICS version, how can I check it? When I do a QW STARTBR, the last one is V3R1, does that mean Version 3.1 :
Code: |
Item Vendor Product Release Data Base
_ STARTBR IBM CICS CMD LVL SYNTAX V4R1 & PRIOR M
_ STARTBR IBM CICS/TS OS/390 SYNTX V1R3 M
_ STARTBR IBM CICS/TS Z/OS SYNTX V2R1 M
_ STARTBR IBM CICS/TS Z/OS SYNTX V2R2 M
_ STARTBR IBM CICS/TS Z/OS SYNTX V2R3 M
_ STARTBR IBM CICS/TS Z/OS SYNTX V3R1 M |
When I did as Earl suggested, I get an abend XPFC. |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
Your workaround is not a good aproach
It looks like your have TS level 3.1
to verify CICS level, ask your CICS technical support,
or run Transaction
CEMT I SYSTEM
look at Cicstslevel(030100)
the move high values
and startbr followed by readprev should work. |
|
Back to top |
|
|
|