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



Hmmm - guess I think that is needed only when you know you'll be doing a call from a command line or with literals - even there, you can always use the hex value that you need to pass.

And this might be useful when doing kind of generic stuff - but I'm all for matching caller and callee, as has been discussed here many time. And I'm not sure it's always best to use 15,5 for everything.

JMHO
Vern

John McKay wrote:
Vern,

Yes - but I was specified "best" as in best practice ...


----- Original Message ----- From: "Vern Hamberg" <vhamberg@xxxxxxxxxxx>
To: "RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
Sent: Wednesday, April 22, 2009 1:06 PM
Subject: Re: Call a RPG program from a CL, decimals error


Hi John

The 15,5 is needed if he passes numeric literals - he is passing a
declared variable, so it is not needed here, at least as far as I know,
which ain't far these days.

Vern

John McKay wrote:
The lengths of your parameters do not match.

Also its best to specify numeric parameters in this case as 15,5 - i.e.
length 15 including 5 decimal places.


Regards,
John McKay

www.rpglanguage.com
www.mckaysoftware.ie

----- Original Message ----- From: "PEPITOVADECURT" <pepitovadecurt@xxxxxxxxx>
To: <rpg400-l@xxxxxxxxxxxx>
Sent: Wednesday, April 22, 2009 10:51 AM
Subject: Re: Call a RPG program from a CL, decimals error


Hi this is the definition in RPG, is correct?
C *ENTRY PLIST
C PARM P0S9NN 309
C PARM P0S9NP 36

Thank's


J.Beckeringh@xxxxxxxxxxxxxxxxxxxxxxxxxx
escribió:

Then obviously the definition in your RPG program does not match the
definition in your CL program. Make sure that the definition in RPG
specifies packed, not zoned.

Joep Beckeringh


rpg400-l-bounces@xxxxxxxxxxxx wrote on 22-04-2009 10:56:23:


Hi I call a RPG program from a CL but a decimal data error appears when
call a RPG program.

PGM
DCL VAR(&VAR1) TYPE(*DEC) LEN(9 5)
DCL VAR(&VAR2) TYPE(*CHAR) LEN(10)
DCL VAR(&RESU) TYPE(*CHAR) LEN(10)
DCL VAR(&PAN) TYPE(*CHAR) LEN(10)
RTVDTAARA DTAARA(*LDA (511 10)) RTNVAR(&PAN)

CHGVAR VAR(&VAR1) VALUE(1234,01200)

/* Send num ex: 1231,2100 and returns 1.231,21 */
CALL PGM(PR2535) PARM(&VAR1 &VAR2)
CHGVAR VAR(&RESU) VALUE(&VAR2)

SNDBRKMSG MSG(&RESU) TOMSGQ(&PAN)
ENDPGM


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.