IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Regarding mroe data to be processed in COBOL Stored Procedur


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vinu78

Active User


Joined: 02 Oct 2008
Posts: 179
Location: India

PostPosted: Mon May 27, 2019 7:31 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2567
Location: NYC,USA

PostPosted: Wed May 29, 2019 2:28 am
Reply with quote

Don't LOBs help here?
Back to top
View user's profile Send private message
vinu78

Active User


Joined: 02 Oct 2008
Posts: 179
Location: India

PostPosted: Wed Jul 03, 2019 10:53 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8569
Location: Dubuque, Iowa, USA

PostPosted: Wed Jul 03, 2019 10:59 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts SKIP LOCKED DATA in UPDATE statement DB2 9
This topic is locked: you cannot edit posts or make replies. Passing a field name to COBOL program COBOL Programming 10
No new posts COBOL Performance Tuning COBOL Programming 6
No new posts JCL for replacing code in Cobol JCL & VSAM 7
No new posts COBOL VS SORT Utility for file format... COBOL Programming 6
Search our Forums:

Back to Top