View previous topic :: View next topic
|
Author |
Message |
vinu78
Active User
Joined: 02 Oct 2008 Posts: 179 Location: India
|
|
|
|
Hi All,
I have a COBOL DB2 Stored Proc defined as:
Code: |
WORKING STORAGE SECTION.
01 WS-INPUT-OUTPUT-DATA.
05 WS-INPUT-OUTPUT-AREA OCCURS 300 TIMES
10 WS-INPUT-ACCT-NO PIC X(20).
10 WS-INPUT-DESC PIC X(80).
LINKAGE SECTION
01 WS-INPUT-OUTPUT
49 LS-INPUT-OUTPUT-LEN S9(4) COMP.
49 LS-INPUT-OUTPUT-TEXT PIC X(32700).
PROCEDURE DIVISION.
MOVE LS-INPUT-OUTPUT-TEXT TO WS-INPUT-OUTPUT-AREA |
<Process all the data in this WS-INPUT-OUTPUT-AREA that occurs for 300 times >
This COBOL DB2 Stored Procedure receives data from Java and it is fine.
We are expecting more data from Java and with the VARCHAR limitation of 32767 for field LS-INPUT-OUTPUT-TEXT, I am wondering how we can receive more data.
One solution that I thought is to receive the extra data in
LS-INPUT-OUTPUT-TEXT-2
Code: |
01 WS-INPUT-OUTPUT
49 LS-INPUT-OUTPUT-LEN S9(4) COMP.
49 LS-INPUT-OUTPUT-TEXT PIC X(32700).
01 WS-INPUT-OUTPUT-2
49 LS-INPUT-OUTPUT-LEN-2 S9(4) COMP.
49 LS-INPUT-OUTPUT-TEXT-2 PIC X(20000). |
Is it possible to get both of these variable's data (LS-INPUT-OUTPUT-TEXT and LS-INPUT-OUTPUT-TEXT-2) loaded to single variable WS-INPUT-OUTPUT-AREA, as I am changing the OCCURS of it to 500 times and then process it.
Thanks
Vinu |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
Don't LOBs help here? |
|
Back to top |
|
|
vinu78
Active User
Joined: 02 Oct 2008 Posts: 179 Location: India
|
|
|
|
Hi All,
Yes. I have tried using CLOB and it worked.
However I am facing issues with Junk characters
Defined CLOB in Stored procedure Parameter as
Code: |
IN-DATA CLOB(90000) FOR SBCS DATA CCSID EBCDIC
|
In Stored Procedure defined as
Code: |
LINKAGE SECTION.
01 LS-IN-DATA.
49 LS-IN-DATA-LEN PIC S9(9) COMP-5.
49 LS-IN-DATA-TXT PIC X(90000).
PROCEDURE DIVISION USING LS-IN-DATA.
IF LS-IN-DATA-TXT > SPACE
|
At this point, sometimes we get data around 1000 byte only and remaining bytes are filled with junk characters.
I was thinking of using INSPECT statement, however since CLOB is used, it is not allowing me to do.
Can anyone please help me with a way to get rid of junk characters in this CLOB variable - LS-IN-DATA-TXT.
Thanks
Vinu |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
You have the length. Use reference modification to only grab defined data such as LS-IN-DATA-TXT (1 : LS-IN-DATA-LEN) |
|
Back to top |
|
|
|