View previous topic :: View next topic
|
Author |
Message |
ranjitbhingare
New User
Joined: 30 Nov 2005 Posts: 94 Location: PUNE
|
|
|
|
Hi,
I am receiving INVREQ during ENDBR. I checked key value and its same. Can anyone please jelp me to solve this problem ?
Facts : We have changed the generation field in file key field from 1 byte to 3. Reading file for the same record is successful.
Thanks & Regards,
Ranjit |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Did you issue a STARTBR and it was successful, followed by the READNEXT or READPREV command?
Could a previous ENDBR have already been issued?
Please post your EIBRESP and EIBRESP2 values.
Regards,
Bill |
|
Back to top |
|
|
ranjitbhingare
New User
Joined: 30 Nov 2005 Posts: 94 Location: PUNE
|
|
|
|
Yes , STARTBR, READ and READNEXT was successful. No, no previous ENDBR was executed.
Sorry at the moment my boss is working on that dataset thus I am unable to provide more information. Though during prevoious run it showed me Command : ENDBR and Response : INVREQ
Will post more information as soon as the dataset is released.
Thanks,
Ranjit |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Your reply indicates that you're issuing a STARTBR, then a READ and then a READNEXT?
If you issue a READ (as opposed to a READNEXT or READPREV) while you're in BROWSE mode, the CRP (current record pointer) will no longer be valid and the well-known IBM condition "unpredictable results may occur" will most likely be raised.
In order to perform a READ while you're in BROWSE mode, you must issue a ENDBR first.
You must also save the current KEY value in WS, so you can begin the BROWSE again (STARTBR) after you're finished with the randomly read record.
To begin browsing again, move the last byte of the key to the last byte of redefined binary-fullword, add 1 to the fullword and move the binary-fullword last byte back to your WS key's last byte.
Code: |
03 WS-RECORD-KEY PIC X(12).
03 WS-FWORD PIC 9(08) BINARY.
03 WS-FWORD-X REDEFINES WS-FWORD
PIC X(04).
*
MOVE ZERO TO WS-FWORD.
MOVE WS-RECORD-KEY (12:) TO WS-FWORD-X (4:).
ADD 1 TO WS-FWORD.
MOVE WS-FWORD-X (4:) TO WS-RECORD-KEY (12:).
|
In the above example, if the last byte was equal to '9' (X'F9'), it becomes a SOFA' after the addition, which then allows VSAM to point to the next logical record.
However, if the last byte was equal to X'FF' (an oddity, most likely), you would then move bytes 11-12 of WS-RECORD-KEY to bytes 3-4 of WS-FWORD-X, add 1 to WS-FWORD and store it back in WS-RECORD-KEY, bytes 11-12.
Regards,
Bill |
|
Back to top |
|
|
ranjitbhingare
New User
Joined: 30 Nov 2005 Posts: 94 Location: PUNE
|
|
|
|
Thanks issue is resolved.
It was logical error, ENDBR was getting executed before STARTBR due to silly mistake in IF condition.
Thanks,
Ranjit |
|
Back to top |
|
|
|