View previous topic :: View next topic |
Author |
Message |
gpaulose Beginner
Joined: 04 Sep 2007 Posts: 10 Topics: 4
|
Posted: Thu Jul 10, 2008 8:34 am Post subject: VSAM 22 error in CICS |
|
|
Hi,
I have a VSAM file with first 26 bytes as key. I am not getting any error while I do REPRO to insert values to the VSAM file. But when I access the records through CICS screen I'm getting VSAM 22 error. I do a STARTBR and READNEXT to get the records from VSAM. Could anyone help me on this?
Please let me know if you need more details.
Thanks,
George. |
|
Back to top |
|
|
jsharon1248 Intermediate
Joined: 08 Aug 2007 Posts: 291 Topics: 2 Location: Chicago
|
Posted: Thu Jul 10, 2008 9:46 am Post subject: |
|
|
I suspect there's a write/rewrite in your program(s) somewhere.
Code: | An attempt was made to write a record that would create a duplicate key in a relative file; or an attempt was made to write or rewrite a record that would create a duplicate prime record key or a duplicate alternate record key without the DUPLICATES phrase in an indexed file. |
From what I can tell, a VSAM file status = '22' is only returned for a write/rewrite. |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu Jul 10, 2008 10:23 am Post subject: |
|
|
when do you get the error 22. startbr or readnext? _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
gpaulose Beginner
Joined: 04 Sep 2007 Posts: 10 Topics: 4
|
Posted: Thu Jul 10, 2008 10:24 am Post subject: |
|
|
I get it in Startbr. I handled 22 error inside program. Now I'm getting it in Readnext also. |
|
Back to top |
|
|
gpaulose Beginner
Joined: 04 Sep 2007 Posts: 10 Topics: 4
|
Posted: Thu Jul 10, 2008 10:42 am Post subject: |
|
|
Hi Sharon,
I do not have any write/rewrite in the program. I'm getting it while reading. |
|
Back to top |
|
|
jsharon1248 Intermediate
Joined: 08 Aug 2007 Posts: 291 Topics: 2 Location: Chicago
|
Posted: Thu Jul 10, 2008 1:05 pm Post subject: |
|
|
I should have asked this first. How do you know it's a 22 VSAM return code? Is it possibly EIBRESP=22? EIBRESP=22 is LENGERR, but according to the manual, that's not a condition returned by a STARTBR. Capture the EIBFN to verify which command issued the condition, EIBRSRCE to verify the resource, EIBRESP, and EIBRESP. Also, show us the actual STARTBR and READNEXT you're using. Let us know if the file you're accessing is a KSDS, RRDS, or AIX. |
|
Back to top |
|
|
gpaulose Beginner
Joined: 04 Sep 2007 Posts: 10 Topics: 4
|
Posted: Thu Jul 10, 2008 1:26 pm Post subject: |
|
|
Sorry for the confusion. I'm not getting RESP 22 while STARTBR. It is during READNEXT. It is a KSDS file.
Code: |
EXEC CICS STARTBR
FILE ('OPNORDR')
RIDFLD (WS-OPEN-ORDER-KEY)
KEYLENGTH (LENGTH OF WS-OPEN-ORDER-KEY)
GTEQ
RESP (WS-RSP-CODE)
NOHANDLE
END-EXEC
|
Code: |
EXEC CICS READNEXT
FILE ('OPNORDR')
INTO (WS-OPEN-ORDER-REC)
RIDFLD (WS-OPEN-ORDER-KEY)
KEYLENGTH (LENGTH OF WS-OPEN-ORDER-KEY)
RESP (WS-RSP-CODE)
NOHANDLE
END-EXEC
|
|
|
Back to top |
|
|
gpaulose Beginner
Joined: 04 Sep 2007 Posts: 10 Topics: 4
|
Posted: Thu Jul 10, 2008 1:28 pm Post subject: |
|
|
Key is 26 bytes.
Code: |
15 WS-OPEN-ORDER-KEY.
20 WS-OPEN-ORDER-STORE
PIC 9(04) VALUE ZEROES
20 WS-OPEN-ORDER-ITEM
PIC 9(14) VALUE ZEROES
20 WS-OPEN-ORDER-AVAILDT
PIC X(08) VALUE SPACES
|
Code: |
DELETE (CAOB.OPEN.ORDERS.KSDS) PURGE -
CLUSTER
DEFINE CLUSTER -
(NAME(CAOB.OPEN.ORDERS.KSDS) -
KEYS(26 0) -
INDEXED -
RECSZ(80 80) -
FREESPACE (20 10) -
REUSE -
SPEED -
SHR(2 3) -
VOLUME(* * * * *)) -
DATA -
(NAME(CAOB.OPEN.ORDERS.KSDS.DATA) -
CYL(10 10)) -
INDEX -
(NAME(CAOB.OPEN.ORDERS.KSDS.INDEX) -
CYL(1 1))
|
|
|
Back to top |
|
|
jsharon1248 Intermediate
Joined: 08 Aug 2007 Posts: 291 Topics: 2 Location: Chicago
|
Posted: Thu Jul 10, 2008 2:05 pm Post subject: |
|
|
Try to create a variable as PIC S9(04) COMP to hold the key length. Move the length into that variable, and specify that variable in the KEYLENGTH of the READNEXT. I think LENGTH OF returns a full integer and the KEYLENGTH wants a half word binary. |
|
Back to top |
|
|
gpaulose Beginner
Joined: 04 Sep 2007 Posts: 10 Topics: 4
|
Posted: Thu Jul 10, 2008 3:12 pm Post subject: |
|
|
I think I got the issues.
The file record layout was given in the program like this
Code: |
10 WS-OPEN-ORDER-REC.
15 WS-OPEN-ORDER-KEY.
20 WS-OPEN-ORDER-STORE
PIC 9(04) VALUE ZEROES.
20 WS-OPEN-ORDER-ITEM
PIC 9(14) VALUE ZEROES.
20 WS-OPEN-ORDER-AVAILDT
PIC X(08) VALUE SPACES.
15 WS-OPEN-ORDER-QTY PIC 9(06)V9(03)
VALUE ZEROES.
|
The file length is 80 bytes and fillers were not given for remaining bytes. After giving filler of 45 bytes, it worked properly.
Thanks Sharon, your LENERR helped me in finding the issue. |
|
Back to top |
|
|
jsharon1248 Intermediate
Joined: 08 Aug 2007 Posts: 291 Topics: 2 Location: Chicago
|
Posted: Fri Jul 11, 2008 8:35 am Post subject: |
|
|
Good work. I like it when the op finds and fixes the problem on their own. Thanks for the follow-up post with the solution. |
|
Back to top |
|
|
|
|