× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Jerry,

Program parameters are input-only in many (if not most) environments. That includes Windows, Unix, PHP, Java, OCL, etc, etc... pretty much everywhere. (Except, of course for RPG, CL, Cobol and ILE C -- but you know that already.)

So parameters are one-way in OCL. You can use the LDA as an alternative. You don't have to wait for the program to end to use the LDA this way, you just have to stop using the archaic 'UDS' data structures, and use RPG III or RPG IV data area capabilities instead of the RPG II UDS data structs. In RPG III/IV data area capabilities, the OUT opcode will update the LDA at the moment you run the opcode.

IMHO, using the LDA is really archaic, limited, and difficult to maintain.... but, golly -- you're using OCL for crying out loud. You've already lost that battle.

Jerry Adams wrote:
I have often passed parameters to a program from a /36 procedure, such as:
CALL PGM(PGMA) PARM('PARM1' 'PARM2'), or
CALL PGM(PGMA) PARM(?1? ?2?)
where the parameter conditions something in the callee (PGMA).

Now I would like to be able to receive information from the callee to condition something in the /36 procedure.

I tried the second example, but the call resulted in a pointer error.

Using the local data area works as an interface between the 36E and an RPG IV program, but not if the program (PGMA, for example) is called by another RPG IV program as the LDA is not updated until the caller ends.

Why the gyrations? Well, I wrote a program a couple of years ago simply for the 36E. It updated the LDA and the OCL can interpret the results. Now, though, I have found a need to call this same program from within an RPG IV program.

My best guess right now is to update both the LDA *and* pass a parameter. The former (LDA) for use by the 36E; the latter for use by a program.

Jerry C. Adams
IBM System i Programmer/Analyst
--
B&W Wholesale
office: 615-995-7024
email: jerry@xxxxxxxxxxxxxxx



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.