×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




The most common cause of this problem is data type mismatch. Is TPKey in the RPG program possibly a data structure subfield, or is it defined as signed (or even integer)? CL *DEC variables are packed only. RPG is a lot more flexible. Try putting the CL in debug, and before it tries the execute the IF, examine the contents of &tpkey. If you see a blank between each digit, it's actually signed (zoned) data. You can fix that either by changing the RPG parm to

parm tpkey pkd5

where pkd5 is defined like

D pkd5 S 5P 0

or by changing the definition of the CL parameter to *CHAR 5, and then using CHGVAR to put that value into a *DEC variable.

At 18:34 08/01/2003, Tim Hatzenbeler wrote:
I have this rpg code, and i'm calling a CL, but the CL is giving a decimal
data error and i was wondering, what I might need to fix..

PO number 20 char and tpkey is 5,0

tpkey = -11 (negative)

c                   eval      errmsg = 'No Errors for '+
c                             %trim(ponumber)
c                   call      'SBMEDI'
c                   parm                    ponumber
c                   parm                    tpkey
c                   eval       *inlr = *on

CL looks like this..

PGM PARM(&PONBR &TPKEY)

       DCL        VAR(&PONBR) TYPE(*CHAR) LEN(20)
       DCL        VAR(&TPKEY) TYPE(*DEC) LEN(5 0)

IF COND(&tpkey *EQ -11) THEN(DO)

....
...   it fails on the if.   any ideas?

Pete Hall pbhall@xxxxxxxxxxxxx http://www.pbhall.us/


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