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
 

 

Convert certain fields of a file from characters to hexa

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Convert certain fields of a file from characters to hexa
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: 2150
Location: At my coffee table

PostPosted: Fri May 09, 2008 5:45 pm    Post subject:
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 Moderator


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

PostPosted: Fri May 09, 2008 9:07 pm    Post subject:
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Mon May 12, 2008 8:39 pm    Post subject:
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 Moderator


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

PostPosted: Mon May 12, 2008 9:26 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm


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