I used REXX to query the DB2 Tables. I used the sql Query by means of Cursor and i give different inputs everytime. Whenver, i'm giving the input one by one from the REXX PROC to the Cursor, Output Host Variable Value has not changing. Is that Host Variable value will not change? Pls tell me whats the issue.
Below is my Rexx code.
DO I = 1 TO COUNT
INPUT = A.I
SAY "VALUE: " VAR1
QUERY6= "SELECT * ",
"WHERE <conditions = INPUT>",
"ORDER BY <Col> DESC",
"FETCH FIRST 1 ROWS ONLY WITH UR"
ADDRESS DSNREXX 'EXECSQL PREPARE S7 FROM :QUERY6'
IF (SQLCODE \= 0) THEN CALL SQLC1
ADDRESS DSNREXX 'EXECSQL DECLARE C7 CURSOR FOR S7'
ADDRESS DSNREXX 'EXECSQL OPEN C7'
ADDRESS DSNREXX 'EXECSQL FETCH C7 INTO :'VAR1''
ADDRESS DSNREXX 'EXECSQL CLOSE C7'
OUPUT LIKE :
Always Host Variable - VAR1 is showing the First output value. Its not showing other o/p Values, when other inputs are giving. I think Once these host variables get assigned to a Value at the first time, its not Changing till the EXIT.
Pls help me in this Issue...