Solved

Passing Array in RPGLE Free Format

Posted on 2015-01-26
5
1,476 Views
Last Modified: 2015-01-29
Hi,

I will post more information if needed, but I'm hoping this is quick. I'm a bit brain dead.  (long day).  I have two arrays (occur 99 size 9A: occur 99 size 1A).  I'm using CALLP from rpgle free format to another free format rpgle program with EXTPGM and *ENTRY.  I want to pass both arrays, do updates, and pass back. I'm getting a variety of errors depending on how I handle it.  (I have done this a number of times in RPG.)

Can I do this? What is the simplest way?
Thank you for your help.  If specifics are need please let me know.
Lynn
0
Comment
Question by:lynn_harris
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
Gary Patterson earned 500 total points
ID: 40572615
Here's sample code showing how to pass an array.  Parameters just need to match.

http://www.rpgiv.info/mambo/index.php?option=com_content&task=view&id=486&Itemid=9

Can't help but notice the use of "occur" in your question.  Are you really trying to pass an array, or are you trying to pass a multiple-occurrence data structure?

Passing a MODS is different, and a little trickier.  Here's a nice explanation and example:

http://iprodeveloper.com/rpg-programming/multiple-occurrence-data-structures-parameters

Feel free to post some code if you'd like specific help.

- Gary
0
 

Author Comment

by:lynn_harris
ID: 40572708
Hi Gary,

Thank you.
You are correct (I was fried). It should've 'DIM'. It is an array, but passing a MODS would be great to know.

I have a meeting in a minute and won't get to try this for a bit.  I will read through the information and either post more or close.

Thanks again!
Lynn
0
 
LVL 35

Expert Comment

by:Gary Patterson
ID: 40572789
Happy to help.

- Gary
0
 
LVL 27

Expert Comment

by:tliotta
ID: 40576681
One minor change can be useful. Instead of this:
     D MyProc          PR
     D   Parm1                        3a   dim(10)

     D Array           s              3a   dim(10)

Open in new window

Consider this:
     D MyProc          PR
     D   Parm1                             like( Array ) dim(10)

     D Array           s              3a   dim(10)

Open in new window

It might not make much difference in your case, but the use of LIKE() for a prototype can be helpful in numerous cases. I tend to use it wherever it works.

Tom
0
 

Author Comment

by:lynn_harris
ID: 40577376
Hi,

Tom, thank you for the tip on using the LIKE().  

I have been pulled away temporarily and will not be able to work on this for a few days.  So, I'm going to close it for now and open another question if I get stuck. I don't like to leave answered question hanging.  

Thanks again,
Lynn
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to import Lotus Notes Contacts into Outlook 2016, 2013, 2010 and 2007 etc. with a few manual steps. You can easily export and migrate Lotus Notes contacts into Microsoft Outlook without having to use any third party tools.
First of all let me say that the only language that I speak is English, but in answering questions here I often come across people whose English skills are not the best and I’d like to be able to communicate better with them, and the following descr…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question