Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 158
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: 2502
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: 8593
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: 2502
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: 8593
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: 158
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 REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
No new posts REXX compiled via RXTCOMP sergeyken CLIST & REXX 7 Tue Feb 07, 2017 9:41 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us