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

Need to convert output from hex to char.


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

New User


Joined: 08 Jul 2006
Posts: 28
Location: Singapore

PostPosted: Wed Sep 26, 2007 10:26 pm
Reply with quote

I need a little help from you. I wrote a sort job which had to copy records on the basis of sort criteria to an output file.

The input file was in HEX format.
The input file was a vsam with VB structure.
The output file was a PS with VB format.

When I got the output I could see all in 'HEX' format. But I wanted all to appear in char format so that I can download it to my desktop. Please advise how to proceed in such case.

If you need further info please let me know.
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: Wed Sep 26, 2007 11:18 pm
Reply with quote

Quote:
When I got the output I could see all in 'HEX' format. But I wanted all to appear in char format so that I can download it to my desktop.


It's not clear what you mean by this.

Do you mean HEX format like 'F0' for '0', 'C1' for 'A', etc or something else?

Please explain clearly what you mean by HEX format.

Please show an example of what the records look like and what you want them to look like.
Back to top
View user's profile Send private message
malayajena

New User


Joined: 08 Jul 2006
Posts: 28
Location: Singapore

PostPosted: Wed Sep 26, 2007 11:38 pm
Reply with quote

yes, you are right...i need to do a "HEX ON' to see data.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Wed Sep 26, 2007 11:45 pm
Reply with quote

Hi Malayajena,

Wuld you please more clear?Would u please provide us sample i/p & o/p?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Sep 27, 2007 12:32 am
Reply with quote

malayajena wrote:
yes, you are right...i need to do a "HEX ON' to see data.
Neat, could you copy a couple lines from your screen with HEX ON and post it here?
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: Thu Sep 27, 2007 12:54 am
Reply with quote

Quote:
yes, you are right...i need to do a "HEX ON' to see data.


That's it. That's all you can offer? Is that supposed to help us figure out what the data is? It doesn't.

The data could be anything in that case. For example, it could be PD values or BI values or FI values or ZD values. Or it could be something else. You need to know the starting position, length and format of each value before you can determine how to convert it to meaningful printable characters. If you don't know that, you could copy some lines from your screen with HEX ON and post it here as William suggests and we can take guesses at what the fields represent.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Sep 27, 2007 1:41 am
Reply with quote

It could be that data is ASCII which would make most of undisplayable.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Sep 27, 2007 2:08 am
Reply with quote

Hello,

Quote:
yes, you are right...i need to do a "HEX ON' to see data.
Ok, so you need to do HEX ON to "see" the data.

Now, post a bit of the HEX ON data (copy/paste) that you see. Do not try to post the entire screen, just a few lines of the "hex on" data.

What you have done is very much like calling a mechanic and saying "There is something wrong with my car. How do i fix it?". How could the mechanic have any idea what "something wrong" means?
Back to top
View user's profile Send private message
malayajena

New User


Joined: 08 Jul 2006
Posts: 28
Location: Singapore

PostPosted: Thu Sep 27, 2007 5:13 am
Reply with quote

Hi All....Thanks all for your time..i am really sorry for being so inexplicit...here are few details what you want...
after doing 'hex on' in output file i see below ...

----------------------------------------------
...........2.--.12.--............-.% 00..T109010/500 121 UBS AG ZURICH
10100200001F0771FF0781000000000017064FF00EFFFFFF6FFF44FFF4444ECE4CC4EEDCCC4
20104C0000C2003C12000C0000C00001675C0000C3109010150000121000042201709499380
--------------------------------------------------------------------------
...........2.--.62.--............-.% 00..T109010/500 121 UBS AG ZURICH
10100200002F0771FF0781000000000017064FF00EFFFFFF6FFF44FFF4444ECE4CC4EEDCCC4
20104C0000C2003C62000C0000C00001675C0000C3109010150000121000042201709499380
----------------------------------

i would like to see the data in the below format...
-----------------
12001100042 73168 2 70808 62 70821 0.00 2400000.00 0 0 T243844/500 112 UBS AG ZURICH TC B2B, ZH
12001100042 73169 2 70820 12 70821 0.00 114743.28 0 0 T 03363/500 121 UBS AG ZURICH TC B2B, ZH
--------------------------
I have this sort cond:
SORT FIELDS=COPY
INCLUDE COND=(5,6,CH,EQ,X'12001100042C')

INPUT file: VSAM variable block.
OUTPUT: PS variable block.

Please let me know if you need further info.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Sep 27, 2007 5:40 am
Reply with quote

Hello,

You have "normal" mainframe records that have packed-decimal numbers in addition to displayable numbers, letters and other characters. I've aligned your input and "Coded"ed it (using the "Code" tab near the top of the reply panel) so that the hex values are under the "display" characters.


Code:
----------------------------------------------
...........2.--.12.--............-.% 00..T109010/500  121    UBS AG ZURICH
10100200001F0771FF0781000000000017064FF00EFFFFFF6FFF44FFF4444ECE4CC4EEDCCC4
20104C0000C2003C12000C0000C00001675C0000C3109010150000121000042201709499380
--------------------------------------------------------------------------
...........2.--.62.--............-.% 00..T109010/500  121    UBS AG ZURICH
10100200002F0771FF0781000000000017064FF00EFFFFFF6FFF44FFF4444ECE4CC4EEDCCC4
20104C0000C2003C62000C0000C00001675C0000C3109010150000121000042201709499380
----------------------------------


Please review this "input" and what you posted as desired oujtput - the values in your output do not match the values in this input.

Re-post some input and output that are for the same data.
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: Thu Sep 27, 2007 5:57 am
Reply with quote

malayajena,

That's better. It appears you have PD fields and CH fields intermixed.

The output you say you want doesn't actually correspond to the input fields. For example, your second input field is P'1' and P'2', but you show the output as 73168 and 73169 ... I don't know where those came from.

At any rate, here's a DFSORT job that should give you the idea of how to do what you want.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=... input file (VSAM)
//SORTOUT DD DSN=...  output file (VB)
//SYSIN    DD    *
  SORT FIELDS=COPY
  RECORD TYPE=V
  INCLUDE COND=(5,6,PD,EQ,12001100042)
  INREC BUILD=(1,4,
     5,6,PD,EDIT=(TTTTTTTTTTT),X,
     11,5,PD,EDIT=(TTTTTTTTT),X,
     16,1,X,
     17,4,PD,EDIT=(TTTTTTT),X,
     21,2,X,
     23,4,PD,EDIT=(TTTTTTT),X,
     27,5,PD,EDIT=(TTTTTTTT.TT),X,
     32,9,PD,EDIT=(TTTTTTTTTTTTTTT.TT),X,
     41,1,X,
     42,1,X,
     44,2,PD,EDIT=(TTT),X,
     46)
/*


SORTOUT would have the following two output records:

Code:

12001100042 000000001 2 0070731 12 0070801 00000000.00 000000000116770.56 0 0 000 T109010/500  121    UBS AG ZURICH ...
12001100042 000000002 2 0070731 62 0070801 00000000.00 000000000116770.56 0 0 000 T109010/500  121    UBS AG ZURICH ...
Back to top
View user's profile Send private message
malayajena

New User


Joined: 08 Jul 2006
Posts: 28
Location: Singapore

PostPosted: Thu Sep 27, 2007 7:11 pm
Reply with quote

Thanks to Frank and all others who generously putforth their suggestions.
The JCL gievn by Frank gave the result i wanted.

regards
Malaya.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Sep 27, 2007 9:00 pm
Reply with quote

Cool icon_cool.gif

Thank you for posting that you have what you needed.
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 SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top