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: 170
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: 2299
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: 170
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: 8500
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 Extract data from n DB2 Views automat... esmeraldo All Other Mainframe Topics 4 Wed Nov 13, 2019 12:32 am
No new posts adrdssu for copy all data robyjhl JCL & VSAM 5 Tue Nov 12, 2019 11:17 pm
No new posts Convert mainframe data to .csv format... karan_reddy DFSORT/ICETOOL 10 Sat Nov 02, 2019 2:09 am
No new posts COBOL -DB2 SQL code to have GROUP BY ... vinu78 DB2 21 Wed Oct 23, 2019 7:00 pm
No new posts How to place name of the file where t... danielgp89 SYNCSORT 18 Thu Oct 17, 2019 12:55 am

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