Solved

Passing Array in RPGLE Free Format

Posted on 2015-01-26
5
942 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
  • 2
  • 2
5 Comments
 
LVL 34

Accepted Solution

by:
Gary Patterson earned 500 total points
Comment Utility
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
Comment Utility
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 34

Expert Comment

by:Gary Patterson
Comment Utility
Happy to help.

- Gary
0
 
LVL 27

Expert Comment

by:tliotta
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
cwbx.dll not working on 64-bit 6 1,871
how in apache config file makes it run php on iseries? 2 424
as400 calendar 2 143
iSeries Library Syncing 3 160
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
HOW TO: Connect to the VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere (HTML5 Web) Host Client 6.5, and perform a simple configuration task of adding a new VMFS 6 datastore.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now