Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: Convert a Fixed Decimal(5,0) to a char(3)
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: 1105
Location: The Netherlands at Hole 19

PostPosted: Wed Feb 07, 2007 6:19 pm    Post subject:
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    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Feb 12, 2007 3:17 pm    Post subject:
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    Post subject: Re: Convert a Fixed Decimal(5,0) to a char(3)
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: 3158
Location: Tucson AZ

PostPosted: Mon Feb 19, 2007 2:14 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us