Page 1 of 1

Data Conversion: HEXA To CHAR

PostPosted: Mon Jul 04, 2011 5:17 pm
by Vineet
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

Re: Data Conversion: HEXA To CHAR

PostPosted: Mon Jul 04, 2011 6:01 pm
by Robert Sample
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?

Re: Data Conversion: HEXA To CHAR

PostPosted: Mon Jul 04, 2011 6:41 pm
by BillyBoyo
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.

Re: Data Conversion: HEXA To CHAR

PostPosted: Mon Jul 04, 2011 11:44 pm
by dick scherrer
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.

Re: Data Conversion: HEXA To CHAR

PostPosted: Tue Jul 05, 2011 11:42 pm
by Frank Yaeger
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