ramco_sita
New User
Joined: 25 Jun 2007 Posts: 40 Location: chennai
|
|
|
|
Hi
I am doing a select * from table name.
table name has got custid and custname.
This table has got only 2 rows.
I retrieve the data and move it to the dfhcommarea variable declared as LS-COMM Pic x(100).
when i do a display LS-comm in my cobol and compile it works.(that is i am able to see both the records)
the code that i am using:
IDENTIFICATION DIVISION.
PROGRAM-ID. M22AP01.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
EXEC SQL INCLUDE SQLCA END-EXEC.
EXEC SQL INCLUDE CUST END-EXEC.
EXEC SQL
DECLARE CUR1 CURSOR FOR
SELECT CUSTOMERNO,CUSTOMERNAME FROM CUST
END-EXEC.
01 WS-CUST PIC X(200).
01 COMMAREA-IN.
03 WS-CUSTOMER PIC X(200).
LINKAGE SECTION.
01 DFHCOMMAREA.
03 LS-CUSTOMER PIC X(200).
PROCEDURE DIVISION.
EXEC SQL
OPEN CUR1
END-EXEC.
PERFORM PARA1 UNTIL SQLCODE NOT EQUAL TO 0.
PARA1.
EXEC SQL
FETCH CUR1 INTO :CUSTOMERNO,:CUSTOMERNAME
END-EXEC.
IF SQLCODE = 0
STRING CUSTOMERNAME DELIMITED BY SIZE,
"~" DELIMITED BY SIZE,
CUSTOMERNAME DELIMITED BY SIZE,
"#" DELIMITED BY SIZE
INTO WS-CUST
END-STRING
MOVE WS-CUST TO LS-CUSTOMER.
* DISPLAY LS-CUSTOMER.
* DISPLAY CUSTOMERNAME.
ENDPARA.
EXEC SQL
CLOSE CUR1
END-EXEC.
EXEC CICS RETURN
END-EXEC.
STOP RUN.
My java code has to read that string and display..
Currently it is only displaying the last record in the table.
we need to resolve this quickly.
your guidance is greatly appreciated.
Thanks |
|