|
|
| Author |
Message |
aniljobs04
New User
Joined: 21 Apr 2005 Posts: 3
|
|
|
|
| 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 |
|
 |
References
|
Posted: Sat Jul 23, 2005 2:46 pm Post subject: Re: How to convert comp variables into numberic in REXX |
 |
|
|
 |
Ravi gaur
New User
Joined: 12 Jul 2005 Posts: 44
|
|
|
|
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 |
|
 |
aniljobs04
New User
Joined: 21 Apr 2005 Posts: 3
|
|
|
|
| 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 |
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 3173 Location: Charlotte,NC USA
|
|
|
|
| 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 |
|
 |
aniljobs04
New User
Joined: 21 Apr 2005 Posts: 3
|
|
|
|
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 |
|
 |
|
|