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: 2180
Location: Hampshire, 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: 2165
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: 2165
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 Procedure Division Section socker_dad COBOL Programming 2 Wed Jun 12, 2019 12:21 am
No new posts How to DEBUG DB2 Stored Procedures Us... thesumitk DB2 0 Mon Jun 03, 2019 8:26 pm
No new posts Regarding mroe data to be processed i... vinu78 DB2 1 Mon May 27, 2019 7:31 pm
No new posts S0C7 abend while running a Cobol Program amitc23 COBOL Programming 2 Tue May 07, 2019 4:06 pm
No new posts Can we pass cobol pointer to cobol-db... rohanthengal DB2 4 Tue Mar 19, 2019 1:04 pm

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