SQLCODE +354 at the time of multifetch



Get solution for your ABEND Codes & System Error Messages, SQL Codes, File Status etc...

SQLCODE +354 at the time of multifetch

Postby DNair7 » Tue Sep 15, 2009 9:36 pm

:( :( :( :( :( :( :( :(

Hi,
I am using multi fetch functionality for my DB2 program. below is my sorty card and fetch statement.

EXEC SQL                                                     
   DECLARE CRD-ACCT-CUR CURSOR WITH HOLD                     
                               WITH ROWSET POSITIONING FOR   
      SELECT CA_NO,                                         
             CORP_IND_CD,                                   
             CA_LAST_STMT_DT,                               
             CA_OPENING_BAL_AM,                             
             CA_CANC_CD,                                     
             CA_CANC_DT                                     
      FROM V07_CHARGE_ACCOUNT                               
      WHERE   CA_CANC_CD NOT IN ('0','1','A')               
        AND   SUBSTR(CA_BILL_POINT_CD,1,1) = :WW-CYC-NO     
        AND   CA_BILL_CURR_CD = :WW-CURR-CD                 
        AND   CA_OPENING_BAL_AM < 0                         
        AND ((CA_CANC_DT > :V2327-BILL-DT                   
        AND   CA_CANC_DT <= CA_LAST_STMT_DT)                 
        OR   (CA_CANC_DT IS NULL))                           
END-EXEC.                                                   


EXEC SQL                                             
    FETCH NEXT ROWSET FROM CRD-ACCT-CUR FOR 10 ROWS 
    INTO :WT-CA-NO,                                 
         :WT-CORP-IND-CD,                           
         :WT-CA-LAST-STMT-DT,                       
         :WT-CA-OPENING-BAL-AM,                     
         :WT-CANCELLATION-CODE,                     
         :WT-CANCELLATION-DATE                       
END-EXEC.                                           

EVALUATE SQLCODE                                         
      WHEN ZERO                                           
           MOVE ZERO               TO WW-COUNTER         
           MOVE SQLERRD(3)         TO WW-ROWS-FETCHED     
           PERFORM CA-PROCESS-BASIC-ACCOUNT UNTIL         
                           WW-COUNTER >= WW-ROWS-FETCHED 
      WHEN WC-HUNDRED                                     
           SET EOF-CURSOR          TO TRUE               
           MOVE ZERO               TO WW-COUNTER         
           MOVE SQLERRD(3)         TO WW-ROWS-FETCHED     
           PERFORM CA-PROCESS-BASIC-ACCOUNT UNTIL         
                           WW-COUNTER >= WW-ROWS-FETCHED 
      WHEN OTHER                                         
           MOVE 'C-PROCESS'        TO WP-DB2-SECTION-NAME
           MOVE 'V07_CHARGE_ACCOUNT'                     
                                   TO WP-DB2-TABLE-NAME   
           MOVE SPACES             TO WP-DB2-KEY-DATA     
           MOVE WM-ERR-MESS-06     TO WM-ABEND-MSG-TEXT   
           PERFORM ZB-DB2-ABEND                           
END-EVALUATE.                                             


As i am abending the program if i encounter any sqlcode other than '0' ,'100'. Below is the message i am getting

+354 A ROWSET FETCH STATEMENT MAY HAVE RETURNED ONE OR MORE ROWS OF
DATA. HOWEVER, ONE OR MORE WARNING CONDITIONS WERE ALSO
ENCOUNTERED. USE THE GET DIAGNOSTICS STATEMENT FOR MORE INFORMATION
REGARDING THE CONDITIONS THAT WERE ENCOUNTERED


Can you please help me on this...?
DNair7
 
Posts: 7
Joined: Tue Jul 14, 2009 11:48 am
Has thanked: 0 time
Been thanked: 0 time

Re: SQLCODE +354 at the time of multifetch

 

Re: SQLCODE +354 at the time of multifetch

Postby dick scherrer » Wed Sep 16, 2009 12:13 am

Hello,

First - please use the "Code" tag for readability. . .

Second - did you use "get diagnostics" to see the information? If not, do so :)
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: SQLCODE +354 at the time of multifetch

Postby DNair7 » Wed Sep 16, 2009 9:48 pm

Hi Dick,

thank a lot for your response, the problem is solved. I didnt use a Null indicator for the Cancellation Date that i am fetching from the database (as it can be null).
Thanks again,
Deepak Nair
DNair7
 
Posts: 7
Joined: Tue Jul 14, 2009 11:48 am
Has thanked: 0 time
Been thanked: 0 time

Re: SQLCODE +354 at the time of multifetch

Postby dick scherrer » Fri Sep 18, 2009 11:59 pm

You're welcome - good to hear it is working - thanks for posting the resolution :)

d
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to ABENDS & SQL Codes

 


  • Related topics
    Replies
    Views
    Last post