View previous topic :: View next topic
|
Author |
Message |
satish.ms10
Active User
Joined: 10 Aug 2009 Posts: 184 Location: India
|
|
|
|
Hi,
My requirement is I have an input file with six byte character value as a key and that six byte character value need to convert 3 bytes and the converted value should be writen to output file.
I have planned to do this using rexx. Could anyone suggest me which functions I should use to convert six byte value to 3 bytes?
Please guide me in this regard.
Sample input:
Expected output is (In hexa format):
Code: |
----+----1----+
sî@
A57444444444444
26C000000000000
---------------
sÈð
A78444444444444
24C000000000000
|
|
|
Back to top |
|
|
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
Hi,
You may want to refer X2C, Built in function. Refer in 'TSO/E Rexx Reference' for detailed info. Hope your input file is not huge. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
I believe you meant "C2X"?
Bill |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
X2C is the correct function, as it will take a HEX representation and convert it to characters.
Code: |
INP = '1A2576F'
OUT = X2C(INP) |
Results in
Code: |
sï?
0A56444444444
127F000000000 |
|
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Expat,
After further review, you're right. However, a quick glance seems to suggest the OP needs to go from 6-bytes CHAR to 3-bytes HEX.
Read it too fast....
Bill |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
I've been caught out by that in the past. C2X just seems the logical function to use. Took me ages to finally get my head around it. A bit like COND= in its own little way |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What happens when there is a G in the input key. . .? Or an R. . .? |
|
Back to top |
|
|
satish.ms10
Active User
Joined: 10 Aug 2009 Posts: 184 Location: India
|
|
|
|
All you you thank you very much.
It is working fine with "X2C" function.
Hi Bill & Expat,
I also did same mistake by using "C2X" function.
Hi Senjay,
Thanks for your quick reply.
Hi Dick,
It is confirmed that A to F only the possible values.
Thank you once again for all your kind support and guidance. |
|
Back to top |
|
|
|