View previous topic :: View next topic
|
Author |
Message |
Log Thangavel
New User
Joined: 19 Jan 2018 Posts: 18 Location: USA
|
|
|
|
Hi,
Can someone help me to covert hex format to displayable format using SORT
The value stored in Input file as X'8900'
80
90
I want this to be printed in output file as 8900. But when I tried to convert using the below card it coming as '0890'
20,2,PD,TO=ZDF,LENGTH=4 (The value start from position 20 in input file)
Read more: ibmmainframes.com/privmsg.php?folder=outbox&mode=read&p=45013#ixzz5gEHZdawn |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Did you try the 'HEX' operator? |
|
Back to top |
|
|
Log Thangavel
New User
Joined: 19 Jan 2018 Posts: 18 Location: USA
|
|
|
|
Yes, Tried 20,2,HEX,TO=ZD,LENGTH=4
it throwed an syntax error.
20,2,HEX,TO=ZD,LENGTH=4
*
Any other options? |
|
Back to top |
|
|
Log Thangavel
New User
Joined: 19 Jan 2018 Posts: 18 Location: USA
|
|
|
|
But when I give the below card
20,2,PD,ZD
I was able to see the output file with value
89
FF04
8900
But it just show only 2 bytes and remaining 2 bytes is spaces. With hex on in file I can see the values '8400'.. But not sure why the last 2 bytes comes as spaces |
|
Back to top |
|
|
Log Thangavel
New User
Joined: 19 Jan 2018 Posts: 18 Location: USA
|
|
|
|
Any help is highly appreciated..Thanks |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1222 Location: Bamberg, Germany
|
|
|
|
See Data types first, then do what Arun has suggested.
Code: |
BUILD=(1,2,TRAN=HEX) |
RTFM |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
HEX has nothing to do with PD or ZD, it just translates the input binary value to its equivalent hexadecimal value.
You just need
starting-position,length,HEX
or
starting-position,length,TRAN=HEX as Joerg mentioned. |
|
Back to top |
|
|
Log Thangavel
New User
Joined: 19 Jan 2018 Posts: 18 Location: USA
|
|
|
|
Hi,
The data was stored through this move statement
Move X’8900’ to file
So when I see on file aid it show same as x’8900’. So in this case which function would convert hex to ZD. I tried HEX function and it gives syntax error |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
I tried HEX function and it gives syntax error |
The correct syntax is shown in previous posts. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1222 Location: Bamberg, Germany
|
|
|
|
Log Thangavel wrote: |
Hi,
The data was stored through this move statement
Move X’8900’ to file
So when I see on file aid it show same as x’8900’. So in this case which function would convert hex to ZD. I tried HEX function and it gives syntax error |
Whatever is moved from here to there or where you see it doesn't matter. You have to deal always with the following to achieve what you want:
Input -> some Magic -> Output
The Magic part is why you are here, try for yourself to find solutions first. Look at your data, see patterns you can work with, try solutions as we do. Help others with what you have done. |
|
Back to top |
|
|
Log Thangavel
New User
Joined: 19 Jan 2018 Posts: 18 Location: USA
|
|
|
|
Yay..it worked.. thanks everyone for the suggestion and input.
I tried the Tran function in outrec with our specifying the input format ,like
Outrec fields= (20,2,Tran=Hex)[/list] |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1222 Location: Bamberg, Germany
|
|
|
|
As said, you only converting binary values here. Nothing else. Glad it works Ok now for you. |
|
Back to top |
|
|
|