IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Response code of NOTFND on STARTBR?


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vmj

New User


Joined: 16 May 2006
Posts: 16
Location: Philippines

PostPosted: Wed Jun 27, 2007 1:31 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Jun 27, 2007 2:38 pm
Reply with quote

Why do you want to read past the the last record?
Back to top
View user's profile Send private message
vmj

New User


Joined: 16 May 2006
Posts: 16
Location: Philippines

PostPosted: Thu Jun 28, 2007 6:29 am
Reply with quote

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! icon_biggrin.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Thu Jun 28, 2007 6:48 am
Reply with quote

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
View user's profile Send private message
sangiah

New User


Joined: 10 Jun 2005
Posts: 62

PostPosted: Thu Jun 28, 2007 8:54 am
Reply with quote

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
View user's profile Send private message
vmj

New User


Joined: 16 May 2006
Posts: 16
Location: Philippines

PostPosted: Thu Jun 28, 2007 12:40 pm
Reply with quote

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
View user's profile Send private message
vmj

New User


Joined: 16 May 2006
Posts: 16
Location: Philippines

PostPosted: Thu Jun 28, 2007 12:43 pm
Reply with quote

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. icon_biggrin.gif
Back to top
View user's profile Send private message
Shanthi Jayaraman

New User


Joined: 11 Jun 2007
Posts: 26
Location: Malaysia

PostPosted: Tue Dec 23, 2008 12:22 pm
Reply with quote

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
View user's profile Send private message
lokesh ranjan

New User


Joined: 29 Jul 2005
Posts: 9
Location: Gurgaon

PostPosted: Tue Dec 23, 2008 5:17 pm
Reply with quote

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
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Wed Dec 24, 2008 6:08 am
Reply with quote

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
View user's profile Send private message
Shanthi Jayaraman

New User


Joined: 11 Jun 2007
Posts: 26
Location: Malaysia

PostPosted: Wed Dec 24, 2008 9:47 am
Reply with quote

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
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Wed Dec 24, 2008 9:15 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Parallelization in CICS to reduce res... CICS 4
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts MQ response when MQGET of a stopped q... Java & MQSeries 2
Search our Forums:

Back to Top