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
 

 

How to move Hex values to alphanumeric field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
j_sram

New User


Joined: 03 Jul 2006
Posts: 6

PostPosted: Thu Sep 12, 2013 4:16 pm    Post subject: How to move Hex values to alphanumeric field
Reply with quote

I have hex value as X'0F1D'. I want to move to X(4) variable as 0F1D

So, that If I display alphanumeric field, I should able to see as 0F1D

-----------

If Hex as value X'FF' it should come as FF
For X'1dFF0D1C' as 1dFF0D1C

The target alphanumeric field will have twice the size of hex value field.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Sep 12, 2013 5:14 pm    Post subject: Reply to: How to move Hex values to alphanumeric field
Reply with quote

There are lots of ways. Here's [http://www.ibmmainframes.com/viewtopic.php?p=115071#115071]one[/url].

A simple way is to have a table of 256 two-byte values, and the use each byte of your input as a subscript

Code:
01  subscript-name BINARY PIC 9(4) VALUE ZERO.
01  FILLER REDEFINES subscript-name.
    05  FILLER PIC X.
    05  input-byte-here PIC X.


MOVE each input byte successively to input-byte-here and use subscript-name to put each character pair into your output.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


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