IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Convert certain fields of a file from characters to hexa


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gomu_mm

New User


Joined: 05 Dec 2006
Posts: 19
Location: Chennai

PostPosted: Fri May 09, 2008 5:21 pm
Reply with quote

I have a file with 49 columns. I want the first 12 columns to be as such but columns from 13 to 49 should change to hexadecimal.

The file looks like this,

6203759820060000000000265084730000000000000
6203424720060000000000188060031000000000000
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri May 09, 2008 5:45 pm
Reply with quote

Please produce an example of what you want the output to look like.
Please provide a list of methods available to perform this change.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri May 09, 2008 9:07 pm
Reply with quote

gomu_mm,

Well, going by what I think you said you want, the DFSORT control statements would be:

Code:

   OPTION COPY
   INREC BUILD=(1,12,13,37,HEX)


The output for your input example would be:

Code:

620375982006F0F0F0F0F0F0F0F0F0F0F2F6F5F0F8F4F7F3F0F0F0F0F0F0F0F0F0F0F0F0F0404040404040
620342472006F0F0F0F0F0F0F0F0F0F0F1F8F8F0F6F0F0F3F1F0F0F0F0F0F0F0F0F0F0F0F0404040404040


Whether that's really what you want is another question.
Back to top
View user's profile Send private message
gomu_mm

New User


Joined: 05 Dec 2006
Posts: 19
Location: Chennai

PostPosted: Mon May 12, 2008 8:19 pm
Reply with quote

Hi,

Thanks for your response.

I want the output as given below:

620306652007 Øà@
620306762007 < Êàæ


When I do HEX ON, it looks like,

000002 620306652007 Øà@
FFFFFFFFFFFF0000000011084700000000000044444444444444444444444444444444
62030665200700000C007C004C000C000C000C00000000000000000000000000000000
------------------------------------------------------------------------------
000003 620306762007 < Êàæ
FFFFFFFFFFFF0000000014074900000000000044444444444444444444444444444444
62030676200700000C005C024C000C000C000C00000000000000000000000000000000


My another doubt here is whether Hexa decimal and Packed decimal are the same?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon May 12, 2008 8:39 pm
Reply with quote

gomu_mm wrote:
My another doubt here is whether Hexa decimal and Packed decimal are the same?
Yes, what you are defining as 'Hexa decimal' is packed numeric.
So what you really want is to convert from zoned (displayable) to packed numeric.
To do this, you must specify each input field by starting position and length.
Or try giving a display of one input record and the 'HEX ON' display of the input record after it has been converted....Or if you find it easier, the hex output record and what it would look like if it were input.....
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon May 12, 2008 9:26 pm
Reply with quote

Quote:
When I do HEX ON, it looks like,


The output records you show with HEX ON do not match the input records you showed in your first post.

You need to show a couple of input records and what you want the output records to look like in hex for THOSE INPUT RECORDS.

Quote:
My another doubt here is whether Hexa decimal and Packed decimal are the same?


Hexadecimal is just a way of displaying information - it is NOT a format per se.

Packed decimal is a format with a specific internal representation of d...ds (d is a digit, s is the sign). Hexadecimal can be used to show what packed decimal data (or zoned decimal data or binary data etc) looks like internally - it displays each 4 bits (a "nibble") as 0-F.

For example, a packed decimal value of +1234 would be displayed in hex as 01234C and a zoned decimal value of -1234 would be displayed in hex as F0F1F3D4.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top