Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
How to convert comp variables into numberic in REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
aniljobs04

New User


Joined: 21 Apr 2005
Posts: 3

PostPosted: Sat Jul 23, 2005 2:46 pm    Post subject: How to convert comp variables into numberic in REXX
Reply with quote

Hi, i have a PS in which some of the values are comp, i need to capture those comp values of data records in the rexx program, could you please tell me how to get those values?
Back to top
View user's profile Send private message
References
PostPosted: Sat Jul 23, 2005 2:46 pm    Post subject: Re: How to convert comp variables into numberic in REXX Reply with quote

Ravi gaur

New User


Joined: 12 Jul 2005
Posts: 44

PostPosted: Mon Jul 25, 2005 10:00 am    Post subject:
Reply with quote

Hi ,
can u elaborate ..


What i understand u want to read PS ?

If it is write u can use EXECIO to read


If i m wrong plz send me the detail
Back to top
View user's profile Send private message
aniljobs04

New User


Joined: 21 Apr 2005
Posts: 3

PostPosted: Mon Jul 25, 2005 6:44 pm    Post subject:
Reply with quote

Hi, i am able to read the values using EXECIO, and using SUBSTR string function i got the value in a aprticular location but it is a comp value, i need to convert it into number to display, please tell me is there any function to convert packed decimal value to numeric in REXX....
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 2921
Location: Charlotte,NC USA

PostPosted: Mon Jul 25, 2005 7:48 pm    Post subject: Re: How to convert comp variables into numberic in REXX
Reply with quote

aniljobs04@yahoo.co.in wrote:
...please tell me is there any function to convert packed decimal value to numeric in REXX....


A standard Packed Decimal to Decimal Function (P2D):
Code:

/* REXX */
P2D:                                                           
HEX = C2X(ARG(1))                                             
RESULT = LEFT(HEX,LENGTH(HEX)-1)                               
IF RIGHT(HEX,1) = 'D' THEN RETURN '-'RESULT ELSE RETURN RESULT
Back to top
View user's profile Send private message
aniljobs04

New User


Joined: 21 Apr 2005
Posts: 3

PostPosted: Tue Jul 26, 2005 6:32 pm    Post subject:
Reply with quote

Hi, i got solution..
Thanks for the reply...

i coded using the function 'C2D'

like TEMP3=C2D(TEMP2,4)

here, TEMP2 is a cahrecter variable having COMP value,so it converts char to decimal i.e numeric into variable TEMP3
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1