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

CICS -REWRITE QUEUE is giving ITEMERR in 9th Record


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

New User


Joined: 10 Apr 2008
Posts: 17
Location: Bangalore

PostPosted: Thu Sep 10, 2009 11:22 pm
Reply with quote

I am getting ITEMERR(26) while rewrite in queue at 9th record,

could anybody assist me. here is code -
Code:
PERFORM VARYING WM-ITEM-SUB1 FROM +1 BY +1 UNTIL       
                               WS-SUB1 > +21           
    ADD  WM-ITEM-SUB1     TO WM-ITEM-COUNT             
    MOVE 'CNTR'           TO WN-TRAN-ID               
    MOVE EIBTRMID         TO WN-TERM-ID               
    MOVE PECK-CODEI(WS-SUB1)                           
                          TO WN-TEMP-MCAF-CODE         
    MOVE PECK-SEQUENCEI(WS-SUB1)                       
                          TO WN-TEMP-SEQUENCE         
    MOVE PECK-OLDI(WS-SUB1)                           
                          TO WN-TEMP-OLD               
    MOVE PECK-NEWI(WS-SUB1)                           
                          TO WN-TEMP-NEW               
    EXEC CICS WRITEQ TS                               
      QUEUE     (WN-TEMP-ID)                           
      FROM      (WN-TEMP-STORAGE-AREA)                 
      ITEM      (WM-ITEM-COUNT)                       
      REWRITE                                         
      RESP      (WN-CICS-RESPONSE)                     
      MAIN                                             
    END-EXEC                                           
IF WN-CICS-RESPONSE = DFHRESP(NORMAL)                 
   MOVE ZEROS TO WM-ITEM-COUNT                         
ELSE                                                   
MOVE SPACES TO PECK-MESSAGEO                           
MOVE WN-CICS-RESPONSE TO WM-CICS-RESP-DISP             
STRING '270- FATAL CICS ERROR RE-WRITEQ TS RESPONSE = '
       WM-CICS-RESP-DISP DELIMITED BY SIZE             
       INTO PECK-MESSAGEO                             
GO TO 9000-SEND-RETURN

Code'd
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu Sep 10, 2009 11:58 pm
Reply with quote

How do you know it is at the 9th record?
What is the value of WM-ITEM-COUNT?
What is the initial value of WM-ITEM-COUNT before your PERFORM loop starts?

You need to post using BBcode to make the code more readable, too.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Sep 11, 2009 1:25 am
Reply with quote

Issue a READQ TS before the REWRITE, specifying NUMITEMS, which will return the number of items in the TSQ.

Can other tasks access this TSQ simultaneously?

If this is true, then you're going to need ENQ/DEQ logic in ALL programs/tasks which access this TSQ, to ensure proper serialization.

For Threadsafe compliant programs, ENQ/DEQ would be mandatory.

Bill
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 How to split large record length file... DFSORT/ICETOOL 7
No new posts Using API Gateway from CICS program CICS 0
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top