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

Readnext in Alternate index


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

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Wed Mar 17, 2010 3:06 pm
Reply with quote

Hi ,
I had a base cluster with key length as 20 , and two alteranate index for it.

I chnged the key length to 26 bytes in the base and adjusted the key position in the alternate index. i did all this through a Batch Delete-Define job .

But now when i do a REANEXT in the alternate index and check for End-Of-file , its just reading again and again indefinetly,without reaching EOF.
(The readnext used to work before the KEYS were changed)


Please advice if i should do any FCT entry change too ? or what else could be the issue with alternate index
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Mar 17, 2010 3:10 pm
Reply with quote

I think the Remote maximum key length (RMTKEYLEN)
in the FCT has to be changed too.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Wed Mar 17, 2010 4:55 pm
Reply with quote

You haven't provided enough information for us to help you. Are you doing a full key READNEXT or using a generic key? What release of CICS are you using -- FCT entries were replaced by RDO (resource definition online) many, many years ago? Are you using multiple regions (TOR and AOR for example) or is this being done in one region? Is the file assigned to an LSR pool? If so, what are the LSR pool characteristics?

And what does this mean?
Quote:
adjusted the key position in the alternate index
Unless the alternate index key is based on the primary key, just changing the primary key would not require any changes to the alternate index key position (record length, yes -- key position, no).
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Wed Mar 17, 2010 6:10 pm
Reply with quote

PeterHolland wrote:
I think the Remote maximum key length (RMTKEYLEN)
in the FCT has to be changed too.


Am not aware of this term. Could you please explain its significance?



Region is a singe region , not mutiple.
Base cluster key was bytes 1 to 20 and alternate index key positin was 1754th byte from ther 20 bytes

Now the change was Base cluster 1-26 and alternate index 1760 -20 bytes
READNEXT is based on the nonunique key of the aletrnate index.

I think the cics version is 6.5 (not sure)
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Wed Mar 17, 2010 6:18 pm
Reply with quote

Use BBcode (the Code button) to post the EXACT code you are using to do the READNEXT -- from the EXEC CICS through the END-EXEC.
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Wed Mar 17, 2010 6:27 pm
Reply with quote

Code:
EXEC CICS                                   
           STARTBR DATASET (ALT-FILENAME)           
                   RIDFLD  (ALT-KEY)               
                   KEYLENGTH(LENGTH OF ALT-KEY)     
                   EQUAL                           
                   RESP    (CICS-RESPONSE)         
       END-EXEC.                                   



EXEC CICS                                 
   READNEXT DATASET (ALT-filename)         
            RIDFLD  (ALT-key)             
            INTO (ALT-dataset)             
            KEYLENGTH(LENGTH OF ALT-key)   
            RESP    (CICS-RESPONSE)       
END-EXEC.                                 


 EVALUATE TRUE                             
   WHEN RESP-NORMAL                         
        do some process
   WHEN RESP-NOTFND                         
   WHEN RESP-ENDFILE                       
        SET NO-MORE-RECS   To  true and exit the loop


but am always geting the response code as zero stating that a recod has been read successfuly. But i have onlu one row in the file.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Wed Mar 17, 2010 7:10 pm
Reply with quote

Quote:
But i have onlu one row in the file.
WRONG! You have NO rows in the file. Files do not have rows, they have records. You may have one record in the file, but it is completely and totally wrong to say that you have one row in the file.

From the CICS Language Reference manual (link at the top of the page) -- emphasis added by me:
Quote:
If KEYLENGTH is specified on a READNEXT command and is equal to the current key length, this is treated as being no change and the browse is not repositioned. The one exception to this is when KEYLENGTH(0) is specified, which always causes the browse to be repositioned to the beginning of the file.
So the behavior you are seeing is normal and expected and documented in the manual.
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Wed Mar 17, 2010 7:59 pm
Reply with quote

Quote:
But i have onlu one row in the filesize=24]WRONG[/size]! You have NO rows in the file. .



It was a typo .. my Bad .. thanks for correcting icon_smile.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Wed Mar 17, 2010 8:06 pm
Reply with quote

Many terms in IT have very precise definitions and using the wrong term in the wrong context (such as referring to a file having rows) at best indicates carelessness (or incompetence) on the person's part, and at worst indicates the person has absolutely no business being in IT in the first place. There have been quite a few posts on this forum where the person used the wrong term and cause a lot of misguided effort attempting to solve a problem that didn't exist while keeping responders from not focusing on the real issue. If someone isn't sure of the right term, and so indicates, that's a good way to learn along the way. But using the wrong term without knowing it implies much about the person ....
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Wed Mar 17, 2010 8:17 pm
Reply with quote

Robert ,

But my problem still persists. I have removed the Keylength from my READNEXT statement , still i dont see an y difference, the read is just going in loop without coming to EOF.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Wed Mar 17, 2010 9:01 pm
Reply with quote

Do you have a WHEN OTHER on your EVALUATE? There are a lot of possible responses on READNEXT other than NORMAL, NOTFND, and ENDFILE.
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Thu Mar 18, 2010 3:04 am
Reply with quote

First:

run your transaction through an application debugger'
and capture the CICS reponse code you are receiving
from the Startbr and Readnext commands.

2nd:

If you can't resolve from that, Call your CICS technical
Support group and tell them your situation.
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Thu Mar 18, 2010 10:48 am
Reply with quote

I did trace the module, and the response code for READNEXT is 0 .
And yes i do have a when other in my evaluate.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Thu Mar 18, 2010 4:44 pm
Reply with quote

First, I'm not quite sure why you would incur the overhead of the browse and READNEXT for a single record -- but you may have valid reasons to do so.

Second, at this point it appears to be an application issue. If you change the RIDFLD value in any way after the READNEXT, for example, CICS will reset the browse and return the first record found when it does the READNEXT -- so you could easily wind up in a loop.

To continue debugging this problem, I recommend you add a second record with the same alternate index key to the file and use CEDF to trace through the code to see what happens.
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 Cobol file using index COBOL Programming 2
No new posts DL/I status code AK for GU call using... IMS DB/DC 1
No new posts Add column to existing records using ... JCL & VSAM 2
No new posts choice of clustering index DB2 3
No new posts Secondary index error while loading d... IMS DB/DC 2
Search our Forums:

Back to Top