Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Response code of NOTFND on STARTBR?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: Response code of NOTFND on STARTBR?
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: 3158
Location: Tucson AZ

PostPosted: Wed Jun 27, 2007 2:38 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Jun 28, 2007 6:48 am    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Hi All, Need some help here. Similar situation like above bu
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    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us