View previous topic :: View next topic
|
Author |
Message |
avaneendra_linga
New User
Joined: 13 Dec 2006 Posts: 73 Location: Hyderabad
|
|
|
|
hi,
i need to prepare a report from a input PS file. In the input PS file layout some field values are in COMP-3 format.Due to this when i read this file in REXX using DISKR i am getting JUNK values which are coming as ??? and some junck sybols.....
IS THERE ANYWAY IN REXX TO GET PROPERVALUES FOR THIS FIELDS?
IF CAN YOU PLEASE PROVIDE EXAMPLE SYNTAX? |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
search for C2X |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
acevedo wrote: |
search for C2X |
And then chop off the last byte? |
|
Back to top |
|
|
avaneendra_linga
New User
Joined: 13 Dec 2006 Posts: 73 Location: Hyderabad
|
|
|
|
hi,
my input filed value is date value stored in comp-3 format.
i need to convert that into displayable variable in REXX... |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Did you
acevedo wrote: |
search for C2X |
?
It looks like it will work for you:
Quote: |
C2X('0123'X) -> '0123' /* 'F0F1F2F3'X in EBCDIC */ |
|
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
REXX Packed-to-Decimal Function:
Code: |
/* REXX P2D */
Parse Arg number_p
erg = C2X(number_p)
sign = Right(erg,1)
number = Left(erg,Length(erg)-1)
If sign = 'D' Then
Return '-'||number
Else
Return number
|
|
|
Back to top |
|
|
avaneendra_linga
New User
Joined: 13 Dec 2006 Posts: 73 Location: Hyderabad
|
|
|
|
hi,
IT'S WORKING FINE..THANKS A LOT TO EVERBODY FOR IMMEDIATE RESPONCES......
CAN ANYBODY HELP IN PROVIDING THE MANUAL FOR THIS TYPE OF COMMANDS (c2x) FOR FUTURE REFERENCE....... |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
C2X is one of REXX's built-in functions, and they are documented here.
O. |
|
Back to top |
|
|
|