![Sad :(](https://www.ibmmainframeforum.com/images/smilies/icon_e_sad.gif)
![Sad :(](https://www.ibmmainframeforum.com/images/smilies/icon_e_sad.gif)
![Sad :(](https://www.ibmmainframeforum.com/images/smilies/icon_e_sad.gif)
![Sad :(](https://www.ibmmainframeforum.com/images/smilies/icon_e_sad.gif)
![Sad :(](https://www.ibmmainframeforum.com/images/smilies/icon_e_sad.gif)
![Sad :(](https://www.ibmmainframeforum.com/images/smilies/icon_e_sad.gif)
![Sad :(](https://www.ibmmainframeforum.com/images/smilies/icon_e_sad.gif)
![Sad :(](https://www.ibmmainframeforum.com/images/smilies/icon_e_sad.gif)
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.
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.
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.
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...?