I want to convert a Fixed Decimal(5,0) to a char(3) . But I have a compiler restriction that I cannot declare my variables as BASED variable, ie.
DCL WS_DAYS FIXED DEC(5);
DCLWS_DATE CHAR(3) BASED(ADDR(WS_DAYS)); is not allowed.
I found out that I could use the BASED variable, it wasn?t a restricted usage.
The issue was using a PUT SKIP stmt to print the based variable. This is the reason why the 'compiler restriction on usage of BASED variable error' was shown.
Thanks Bitneuker & Shaik !!
Yup william. After compilation, the error message I got was 'compiler restriction the usage of BASED variable not allowed'. I first thought BASED variable itself is not allowed, later I figured out that this was due to using the PUT DATA(<based variable name>); stmt. The learning is that a BASED variable cannot be used for Input-Output related stamts.