CL does not have an INTEGER type, and C does not do PACKED DECIMAL well.
However, you should be able to let CL convert an INTEGER paramarter back
to PACKED DECIMAL.
 
Define the variables as below.  Put &wrkINT on your parameter list,
where the C program will treat it as an INT. 
The first CHGVAR before the call zeroes out the field.
The second CHGVAR after the call changes the INT to PD.

If your using long ints, I believe you can define &wrkINT as TYPE(*CHAR)
LEN(8) 

As long as the C program puts a 4 byte int in the parm, you should be
golden.  This should work in CLP as well as CLLE.  (OPM CL & ILE CL)

DCL VAR(&wrkINT    ) TYPE(*CHAR) LEN(     4) 
DCL VAR(&RRN       ) TYPE(*DEC ) LEN(  15 0)

CHGVAR  VAR(&wrkINT) VALUE(X'00000000')
CALL    PGM(C-PGM) PARM(parm1, pram2 . . . parmX &wrkINT)
CHGVAR  VAR(&RRN) VALUE(%BIN(&wrkINT))


This thread ...


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

This mailing list archive is Copyright 1997-2019 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 here. If you have questions about this, please contact [javascript protected email address].