View previous topic :: View next topic
|
Author |
Message |
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
I think the Remote maximum key length (RMTKEYLEN)
in the FCT has to be changed too. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
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 |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
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 |
|
|
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
|