Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Regarding mroe data to be processed in COBOL Stored Procedur

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
vinu78

Active User


Joined: 02 Oct 2008
Posts: 161
Location: India

PostPosted: Mon May 27, 2019 7:31 pm    Post subject: Regarding mroe data to be processed in COBOL Stored Procedur
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

Senior Member


Joined: 21 Sep 2010
Posts: 2242
Location: NY,USA

PostPosted: Wed May 29, 2019 2:28 am    Post subject:
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: 161
Location: India

PostPosted: Wed Jul 03, 2019 10:53 pm    Post subject:
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: 8479
Location: Dubuque, Iowa, USA

PostPosted: Wed Jul 03, 2019 10:59 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to force ISPF to allocate ISPF te... Michele Giannuli TSO/ISPF 5 Thu Sep 12, 2019 2:03 pm
No new posts Need to fetch data from database base... Satandale COBOL Programming 8 Sun Sep 08, 2019 12:01 am
This topic is locked: you cannot edit posts or make replies. Compare two files logic in COBOL Nishant Singhal COBOL Programming 4 Sun Aug 25, 2019 2:25 am
No new posts How to append data from PARM in OUTFIL Poha Eater DFSORT/ICETOOL 17 Thu Aug 22, 2019 4:03 pm
No new posts Training on numeric fields data formats sergeyken SYNCSORT 12 Thu Aug 01, 2019 8:15 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us