I wrote an RPGLE program that has this D spec: D pcomp s like(icomp) ICOMP is field from a DB file. it's defined as 2 zoned 0 dec. The compiler seems to turn it into a packed field which is causing me trouble (compiler output below): I S 2 3 0ICOMP ICOMP ZONE 2,0 SIGNED *RNF7031 ICOMP P(2,0) 003600 1000003D PCOMP P(2,0) 003600D you can see that the Input spec shows it zoned and so does one other spot in the compiler output, but the third place it appears it has been magically transformed to PACKED! The problem is that PCOMP is therefore packed and I am using it in a parm statement on an *ENTRY plist (I have my reasons for not being more ILE-ish on this one). When an RPG program that I have calls this one, passing ICOMP from the file I get a decimal data error - very frustrating!!! Why oh, why does the compiler insist on packing this field and how do I prevent it from doing so? I could take away the LIKE(ICOMP) and hard code the definition, but that obviously stinks. I could define a separate field in the caller that is packed and then move ICOMP into it, but that is unsatisfying. I want to control the compiler's strange decision to do this to me. Ideally I'd be able to code an "S" for signed in the D spec but SEU won't let me do this with the LIKE keyword. If anybody has a solution or even an explanation, I'd appreciate it. Thanks

Reply With Quote