Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Convert six bytes CHAR value to 3 bytes using REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 161
Location: India

PostPosted: Mon Jul 26, 2010 12:07 pm    Post subject: Convert six bytes CHAR value to 3 bytes using REXX
Reply with quote

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:

Code:

A2567C
A2748C


Expected output is (In hexa format):


Code:

----+----1----+
sî@
A57444444444444
26C000000000000
---------------
sÈð
A78444444444444
24C000000000000
Back to top
View user's profile Send private message

senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Mon Jul 26, 2010 4:09 pm    Post subject: Reply to: Convert six bytes CHAR value to 3 bytes using REXX
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Mon Jul 26, 2010 4:38 pm    Post subject: Reply to: Convert six bytes CHAR value to 3 bytes using REXX
Reply with quote

I believe you meant "C2X"?

Bill
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8666
Location: Back in jolly old England

PostPosted: Mon Jul 26, 2010 5:47 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Mon Jul 26, 2010 6:11 pm    Post subject: Reply to: Convert six bytes CHAR value to 3 bytes using REXX
Reply with quote

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.... icon_redface.gif

Bill
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8666
Location: Back in jolly old England

PostPosted: Mon Jul 26, 2010 6:22 pm    Post subject:
Reply with quote

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 icon_confused.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jul 26, 2010 8:11 pm    Post subject:
Reply with quote

Hello,

What happens when there is a G in the input key. . .? Or an R. . .?
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 161
Location: India

PostPosted: Tue Jul 27, 2010 2:47 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How can I convert charactor to fixed ... liying DFSORT/ICETOOL 7 Tue May 22, 2018 3:35 pm
No new posts Trap the jcl error message or maxcc i... ankita agarwal CLIST & REXX 4 Fri May 18, 2018 2:08 pm
No new posts Rexx command to open an another text ... Bharath Vikraman PC Guides & IT News 7 Sat May 12, 2018 4:34 pm
This topic is locked: you cannot edit posts or make replies. GDG gen check using REXX raghuraman123 CLIST & REXX 6 Wed Apr 18, 2018 9:18 pm
No new posts How to control Panel Attributes throu... rsshanmugam CLIST & REXX 3 Mon Feb 26, 2018 9:51 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us