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 Hex to readable format.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
harpreet_Saini19

New User


Joined: 16 Dec 2015
Posts: 1
Location: India

PostPosted: Wed Sep 14, 2016 5:46 am    Post subject: Convert Hex to readable format.
Reply with quote

I have 2 fields in a file shown below:

VARIABLE1 PIC X(01)
VARIABLE2 PIC X(03)

the values for these 2 fields is in HEX format in my input file as shown below:

VARIABLE1
Code:

.
.
.
.
 
.   


VARIABLE2
Code:

   
µ..
uµ.
uµ.
µ..
   
µ..
µ..


If i do HEX ON in the file then the values for these 2 variables looks like:

VARIABLE1
Code:

.
0
2
-
.
1
0
-
.
1
2
-
.
1
2



VARIABLE2
Code:

   
444
000
---
µ..
A20
002
---
uµ.
AA0
402
---
uµ.
AA0
402



I need to convert these 2 variables to readable format and then load these 2 fields to a table.

Please note: I have already searched for such posts on this forum but in all similar posts the data type of such variables was either binary or packed decimal. But in my case the data type of the variables is Alphanumeric.

I hope my query is bit clear to understand..icon_smile.gif
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Wed Sep 14, 2016 6:30 am    Post subject:
Reply with quote

Quote:
I hope my query is bit clear to understand.
Nope, not at all. The first variable is a one-byte binary field and hence easy enough to convert to a human-readable format - and there are plenty of examples on this forum to follow. However, the second variable -- what do you mean by "readable format"? Should the first value be converted to 'A02012' (that is, merely convert the hexadecimal to characters representing the same value) for the first one, or 10493970 (which is what X'A02012' converts to), or something else you haven't explained?

And, by the way, hexadecimal values are also binary values -- so your point about alphanumeric is totally irrelevant.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Wed Sep 14, 2016 3:31 pm    Post subject:
Reply with quote

And hex 40 is a space which is already readable.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Sep 14, 2016 4:59 pm    Post subject: Reply to: Convert Hex to readable format.
Reply with quote

Is it too difficult to look in the DFSORT manual or attempt some search? The capability is readily available and easy to use.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Wed Sep 14, 2016 6:06 pm    Post subject:
Reply with quote

Do you tend to imply that the copybook fields are alphanumeric and you have these values in it? So far as others have said that's plain conversions from PD/BI to ZD and you will have many examples with handy code.
So if the copybook fields are character field then you will have to ask the people who produced this data set with such data and fix it or change your copybook definition as per the format of the data produced.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Wed Sep 14, 2016 9:01 pm    Post subject:
Reply with quote

harpreet_Saini19,

Welcome to the forums and I'd suggest taking some time to review the responses and answer the questions asked if you have not figured out how to proceed on this.
Back to top
View user's profile Send private message
Kerry Ropar

New User


Joined: 14 Sep 2016
Posts: 25
Location: Australia

PostPosted: Thu Sep 15, 2016 10:07 am    Post subject:
Reply with quote

Hello Harpreet_saini19,

I am fairly new to this forum and this is my first attempt on any post, so wish me luck.

From what I understand, you have packed data coming from some source input (1) which you read into a file which has copybook format of alphanumeric defined for this field in question (2) and you want to load it into a DB2 table (3), and due to the nature of different formats involved you are facing issue.

Please let me know if my understanding is correct ia all tagged points (1/2/3). If yes, may I please request you to share the definitions in DB2 table for the target column.

Kerry.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Thu Sep 15, 2016 4:42 pm    Post subject:
Reply with quote

Kerry: terminology is critical in IT where similar terms may mean very different things. The data displayed is NOT "packed" which has a specific meaning in mainframes. The data is non-display or binary but not packed decimal, which would be the implication of calling it "packed".
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 How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm


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