IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Convert a Fixed Decimal(5,0) to a char(3)


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
arien

New User


Joined: 02 Nov 2006
Posts: 43
Location: London

PostPosted: Wed Feb 07, 2007 5:52 pm
Reply with quote

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
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Wed Feb 07, 2007 6:19 pm
Reply with quote

What if you turn it around like this:

Code:
DCL SEGBND      CHAR(4);                     
DCL BNDSEG      FIXED(7) BASED(ADDR(SEGBND));
Back to top
View user's profile Send private message
arien

New User


Joined: 02 Nov 2006
Posts: 43
Location: London

PostPosted: Wed Feb 07, 2007 6:39 pm
Reply with quote

hmm.. let me try that .. will update !
Back to top
View user's profile Send private message
@stha

New User


Joined: 07 Dec 2006
Posts: 4
Location: chennai

PostPosted: Mon Feb 12, 2007 2:51 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Feb 12, 2007 3:17 pm
Reply with quote

That's strange....arien? @stha? Was that the update?
Back to top
View user's profile Send private message
arien

New User


Joined: 02 Nov 2006
Posts: 43
Location: London

PostPosted: Sun Feb 18, 2007 10:10 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Feb 19, 2007 2:14 am
Reply with quote

Thanks for posting the resolution... icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
Search our Forums:

Back to Top