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: 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: 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: 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: 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 ISREDIT Macro is not returning back t... nico_neoz CLIST & REXX 4 Sat Nov 18, 2017 7:40 pm
No new posts Can EDCICONV convert EBCDIC to ASCII... natt.sut IBM Tools 3 Fri Nov 17, 2017 8:46 pm
No new posts REXX LISTDSI () SMSINFO is not working upendrasri CLIST & REXX 4 Fri Nov 17, 2017 11:33 am
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 4 Wed Nov 15, 2017 4:27 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am

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