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
 

 

Readnext in Alternate index

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: Readnext in Alternate index
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Wed Mar 17, 2010 3:10 pm    Post subject:
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: 7904
Location: Bellevue, IA

PostPosted: Wed Mar 17, 2010 4:55 pm    Post subject:
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    Post subject:
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: 7904
Location: Bellevue, IA

PostPosted: Wed Mar 17, 2010 6:18 pm    Post subject:
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    Post subject:
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: 7904
Location: Bellevue, IA

PostPosted: Wed Mar 17, 2010 7:10 pm    Post subject:
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    Post subject:
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: 7904
Location: Bellevue, IA

PostPosted: Wed Mar 17, 2010 8:06 pm    Post subject:
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    Post subject:
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: 7904
Location: Bellevue, IA

PostPosted: Wed Mar 17, 2010 9:01 pm    Post subject:
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    Post subject:
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    Post subject:
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: 7904
Location: Bellevue, IA

PostPosted: Thu Mar 18, 2010 4:44 pm    Post subject:
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    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 Several errors during building altern... Andi1982 JCL & VSAM 11 Wed Jul 06, 2016 7:39 pm
No new posts Drop building Alternate Index for a p... bhavin.mehta JCL & VSAM 6 Mon Jul 04, 2016 3:47 pm
No new posts VSAM Alternate Index in CICS jacobdng CICS 2 Fri May 06, 2016 1:41 pm
No new posts Rebuilding IMS secondary index withou... Hooman24 IMS DB/DC 6 Tue Mar 29, 2016 12:22 pm
No new posts Problem in READNEXT amitc23 CICS 6 Wed Mar 16, 2016 12:06 pm


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