The quickest way around this is to move the 2S0 (Zoned) number to a character of the same length (2). Use the character variable as the parameter.
E.G. in Program A
MOVE NUM PARM1 2
In Program B
PARM PARM1 2
MOVE PARM1 NUM 2 0
Parameters, I have found, are best passed as charater, especially in RPG/V. In ILE you have more choices. However, when calling an RPG from a CLP or CLLE, you are bound to have problems using *DEC instead of *CHAR for the actual parameters.
Another way around this is to use the *LDA for parameter passing instead of using the PARM op code with a call. However, if you don’t have an estabilished protocol for using the *LDA, I would be careful about starting this now.
The RPG compiler prefers working with packed-decimal numeric fields. Regardless of the definition in a database record, RPG will try to use a packed field in program memory.
If you want to force RPG to use a particular data type, then define a DS like the record format of the database file. The subfield will bring the field attributes into the program.
Note that this can have an additional slight advantage of avoiding data-type conversions as fields are moved into and out of memory.