View previous topic :: View next topic
|
Author |
Message |
arien
New User
Joined: 02 Nov 2006 Posts: 43 Location: London
|
|
|
|
Hi all,
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.
Is there any other way to go about this ? |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
What if you turn it around like this:
Code: |
DCL SEGBND CHAR(4);
DCL BNDSEG FIXED(7) BASED(ADDR(SEGBND));
|
|
|
Back to top |
|
|
arien
New User
Joined: 02 Nov 2006 Posts: 43 Location: London
|
|
|
|
hmm.. let me try that .. will update ! |
|
Back to top |
|
|
@stha
New User
Joined: 07 Dec 2006 Posts: 4 Location: chennai
|
|
|
|
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 !! |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
That's strange....arien? @stha? Was that the update? |
|
Back to top |
|
|
arien
New User
Joined: 02 Nov 2006 Posts: 43 Location: London
|
|
|
|
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.
Regards,
@stha |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Thanks for posting the resolution... |
|
Back to top |
|
|
|