Data Conversion: HEXA To CHAR



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Data Conversion: HEXA To CHAR

Postby Vineet » Mon Jul 04, 2011 5:17 pm

Hi,

I am Having a Sequential File Having Set OF Data. At Specific Position Data is in HEXA DECIMAL (Start Position = 200, End Position = 250). Using SORT I Woul Like to Convert Data in HEXA Format To Character Format & Write Output to Another File. Below are the Attributes:

Input File:
LRECL = 500,Recfm = FB
Col.Position: Start Position - 200, End Position - 250

Example Of Data:

06443
FFFFF000000000000000000000000000000000000000000000000000000
06443000000000000000000000000000000000000000000000000000000
----------------------------------------------------------
06443
FFFFF000000000000000000000000000000000000000000000000000000
06443000000000000000000000000000000000000000000000000000000
----------------------------------------------------------
06443
FFFFF000000000000000000000000000000000000000000000000000000
06443000000000000000000000000000000000000000000000000000000

06003,06012,06014,06046,06051,06052,06055,06074,06083,06091
FFFFF6FFFFF6FFFFF6FFFFF6FFFFF6FFFFF6FFFFF6FFFFF6FFFFF6FFFFF
06003B06012B06014B06046B06051B06052B06055B06074B06083B06091

Its a Set Of Records Seperated by ','.

Thanks
Vineet
 
Posts: 86
Joined: Tue Jun 19, 2007 11:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: Data Conversion: HEXA To CHAR

Postby Robert Sample » Mon Jul 04, 2011 6:01 pm

At Specific Position Data is in HEXA DECIMAL
Actually, EVERY byte of data in EVERY position is hexadecimal. Hexadecimal simply means "base 16" and every byte of every file is one of the 256 base-16 characters -- hence every byte is hexadecimal.

So go back and start over -- when you say "hexadecimal" do you mean zonded decimal, packed decimal, binary, or something else entirely?
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Data Conversion: HEXA To CHAR

Postby BillyBoyo » Mon Jul 04, 2011 6:41 pm

From your limited examples, it looks like you have either a single number (either character or zoned-decimal, basically the same for "numbers"), followed by low-values (hexadecimal 00) to the end of your field, or multiple numbers seperated by commas.

I have no idea what you want to do with them.

So, as clearly as you can, explain what you want.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Data Conversion: HEXA To CHAR

Postby dick scherrer » Mon Jul 04, 2011 11:44 pm

Hello,

Typically, when one has "some data" they want to do somethng with this data. What do you want to do with the data you have?

Or, i suppose you have shown some "input". What output do you want from this input? What are the rules for getting from the input to the output? Mention the recfm and lrecl of the files.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Data Conversion: HEXA To CHAR

Postby Frank Yaeger » Tue Jul 05, 2011 11:42 pm

Vineet,

You sent me the same question offline (please use either the board or e-mail to ask a question - NOT BOTH). Here's my reply:

It isn't clear what you think hexa format means. Hexadecimal is simply a representation of a value in base 16. All values can be represented in hexadecimal.

The real question is, what is the format of your input values (ZD, BI, PD, something else) and what format do you want for the output.

If the data sample you show is the input, then the values are a combination of ZD numbers, commas and binary zeros, so i don't know what kind of conversion you think you need to do. The ZD values and commas are already in "character format", that is, they are displayable. Do you just want to convert the binary zeros to blanks? Or do you want to do something else? What?

You would have to show me an example of your input values in hexadecimal and what you want for output in hexadecimal for me to be able to help you.

Take a look at this description of the various DFSORT formats and see if that helps you figure out what you have/need:

http://publibz.boulder.ibm.com/cgi-bin/ ... 0630155256
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post