Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Array in Cobol Db2 Stored Procedure

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

New User


Joined: 13 Oct 2017
Posts: 31
Location: India

PostPosted: Wed Jan 09, 2019 3:06 pm    Post subject: Array in Cobol Db2 Stored Procedure
Reply with quote

Hi

I have requirement to accept array input variable. I did little google & found some references but not specific to COBOL.

So would be great if someone suggest their experiences.

Step 1 - How to define array in DDL that define SP in DB2

Create Procedure SPname1
( In Variable1 char(08) array[varchar(100)];
out variable2 Integer array[100];
) .

Is above way of writing correct?

Step 2 - How do we define this array in linkage section of cobol SP .

is it the same way that define array(table) in cobol program.
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2153
Location: UK

PostPosted: Wed Jan 09, 2019 5:05 pm    Post subject: Reply to: Array in Cobol Db2 Stored Procedure
Reply with quote

Try your suggestions. If they work post to confirm it. If they do not, post to say that one, or both, of those are not correct.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


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

PostPosted: Wed Jan 09, 2019 9:26 pm    Post subject:
Reply with quote

If you can live with Native SP then try this Example of using arrays in an SQL procedure
These type of stuff is done by DBAs , please check with all the options available with the DB2 version that you have at your site. However you can still use XML instead if not array.
Back to top
View user's profile Send private message
Ashishpanpaliya

New User


Joined: 13 Oct 2017
Posts: 31
Location: India

PostPosted: Wed Jan 09, 2019 10:02 pm    Post subject:
Reply with quote

Thanks Rohit. But the first line in the link says ' An example demonstrates many of the ways that you can use arrays in a native SQL procedure. '

So I am interested in example of external SP.

We are using V12.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


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

PostPosted: Wed Jan 09, 2019 11:26 pm    Post subject:
Reply with quote

That’s why I said you can write in Native and you have that choice then you can use it for external i never worked on array but xml or clob or varchar and I could not find in manuals as well that mentiones of array ( unless someone finds it which I couldn’t)

Why can’t you use native ? If you wants to use external then what’s the issue with xml or pass it in varchar (separated by pipe or anything ) and you get it unsteing in the program later.

https://www.ibm.com/support/knowledgecenter/en/SSEPEK_12.0.0/apsg/src/tpc/db2z_datatypesstoredprocedures.html

Also, please loop DBAs first for any possible design approach if not done already.
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 Can we pass cobol pointer to cobol-db... rohanthengal DB2 4 Tue Mar 19, 2019 1:04 pm
No new posts Call DB2 user defined function from C... Ziko13 DB2 5 Thu Mar 14, 2019 4:46 pm
No new posts z/VM z/VSE Get CPU-time of a COBOL Ba... Andi1982 COBOL Programming 2 Mon Mar 11, 2019 3:36 pm
No new posts COBOL Table Question GAPX1 COBOL Programming 3 Thu Mar 07, 2019 9:48 pm
No new posts Search an array inside an array amitc23 COBOL Programming 5 Thu Jan 24, 2019 4:19 pm

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