× 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.




On 11/02/2009, at 6:45 AM, Piotr Szczurek wrote:

If these 3 variables are splited, then command would be like this: CALL
PGM(IVHHDRO3) PARM('' '120' X'100000001F' X'1090210F') but what if the
are passed as a data structure? CALL PGM(IVHHDRO3) PARM(''
'120'X'100000001F'X'1090210F') is not working ;)

As you've determined the first form is incorrect because you are passing 3 parameters to a program expecting only 1 parameter. The second form isn't a data structure--it's just a mess--and is not syntactically correct.

Because the called program expects a single parameter your code must concatenate these three values into a single value. It must also ensure each part is in the proper place. That is the value for comc must start in position 1, the value for invo must start in position 4, and the value for data must start in position 9.

RPG will have difficulty generically handling the numeric values because you need to get them into a character string but not convert them to character in the process. Your code MUST keep all values in the same form as expected by the called program. You can do this sort of thing by remapping storage so your numeric values can be viewed as if they were character by using a data structure and OVERLAY, or you could convert all three values to their hexadecimal representation and concatenate the hex strings, but you will probably find it easier to use a memory copy function such as memcpy to simply copy the data contained in the numeric variables into a longer character variable representing the single variable you need to construct to pass to the called program.

Something like:

D fakeDS S 1024
D comc S 3
D invno S 9 0
D date S 7 0

C memcpy( %ADDR(fakeDS), %ADDR(comc), %SIZE(comc) );
C memcpy( %ADDR(fakeDS)+%SIZE(comc), %ADDR(invno), %SIZE(invno) );
C memcpy( %ADDR(fakeDS)+%SIZE(comc)+%SIZE(invno), %ADDR(date), %SIZE (date) );


Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------




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.