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
 

 

How to conver a HEX format data into ZD type data?

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

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Fri Mar 15, 2013 9:52 am    Post subject: How to conver a HEX format data into ZD type data?
Reply with quote

for example, I want to convert a S9(9) COMP data into a 9(9) data, how to do this via DFSort?
before conversion:
Code:

....
0000
0009

after conversion:
Code:

000000009
FFFFFFFFF
000000009



before conversion:
Code:

....
000A
0000

after conversion:
Code:

0000000010
FFFFFFFFFF
0000000010



thanks for your help in advance.
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Mar 15, 2013 12:35 pm    Post subject:
Reply with quote

I'm not sure if I follow completely what you mean. Your input is in "HEX" or COMP (BI)?

Possibly, see the following for information on and examples of numeric conversions with DFSORT: http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG20/2.4.7?DT=20060615173822

And see the following for information on and examples of editing numeric values with DFSORT: http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG20/2.4.8?DT=20060615173822


If you're talking about HEX as input, and if you've z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026, you can use DFSORT's TRAN=UNHEX.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Mar 15, 2013 12:47 pm    Post subject: Reply to: How to conver a HEX format data into ZD type data?
Reply with quote

shame on You icon_cool.gif
after five years of hanging around and You still use the wrong terminology ...

HEX vs BINARY

from
Code:
0000
000A


to ( 8 is an arbitrary length NOT related to the original data )
Code:
00000010
ffffffff
00000010

is a numeric conversion

from
Code:
0000
000A


to ( 8 is NOT an arbitrary length ==> it is 8 half bytes )
Code:
0000000A
fffffffc
00000001


is a printable display of data as stored in memory

looks like You wasted everybody' s time on all the questions You asked and all the replies You were given
icon_evil.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Mar 15, 2013 12:57 pm    Post subject: Reply to: How to conver a HEX format data into ZD type data?
Reply with quote

Quote:
before conversion:
Code:
....
000A
0000

after conversion:
Code:
0000000010
FFFFFFFFFF
0000000010



I did not notice before ....
whatever conversion logic You used ... IT WAS WRONG

it should have been

Code:
000000A0
FFFFFFCF
00000010


for a <hex> conversion/display

Code:
00000160
FFFFFFFF
00000160


for a <binary> conversion/display
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Fri Mar 15, 2013 1:16 pm    Post subject:
Reply with quote

Sorry for my bad statement, but I thought binary format data is stored as HEX data after cobol processing...

In fact, the input is a HEX data, and I want to convert it to ZD data...
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Mar 15, 2013 1:27 pm    Post subject:
Reply with quote

Quote:
If you're talking about HEX as input, and if you've z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026, you can use DFSORT's TRAN=UNHEX.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Mar 15, 2013 1:40 pm    Post subject: Reply to: How to conver a HEX format data into ZD type data?
Reply with quote

again, You lost another chance ...

in IT everything is just a sequence of BITS ...

0/1 which to save <paper>/<display> space are represented as hexadecimal ( shorthand for base 16 ) numbers

how to call <the thing> that these bits represent depends on the convention used
( as already explained to You in an old reply )

1 byte, 8 bits
rePRESENTATION
Code:
as BITs ==> 11000001
as HEX  ==> C1


human meaning / interpretation

Code:

for a printable char  ==> A   <== Upper case a ( EBCDIC convention as perp POP )
for a decimal number  ==> 1   <== positive 1 ( ZONED SIGNED DECIMAL as per POP )
for a binary number   ==> 193 <== UNSIGNED ( as per BINARY arithmetic )
or                    ==> -63 <== SIGNED ( same as above )

what is that is not clear in the explanation that You keep using the wrong terminology
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Fri Mar 15, 2013 2:30 pm    Post subject:
Reply with quote

I tried to take advantage of 'TRAN=HEX', but the result is not what I want.
with TRAN=HEX, X'C1F1' (C'A1') would be replaced by C'C1F1', but the result I want is C'49649'(X'F4F9F6F4F9'), which is the printable decimal format of X'C1F1'.

How to achieve this?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Mar 15, 2013 2:49 pm    Post subject: Reply to: How to conver a HEX format data into ZD type data?
Reply with quote

Quote:
In fact, the input is a HEX data, and I want to convert it to ZD data...

You should really meditate on You attitude for an IT career

no reason to waste time explaining and try to make You understand things icon_evil.gif
here is the solution
Code:
****** ***************************** Top of Data ******************************
000003 //*
000004 //S       EXEC PGM=SORT
000005 //SYSOUT    DD SYSOUT=*
000006 //SYSPRINT  DD SYSOUT=*
000007 //SORTIN    DD *
000008 A1
000009 //SORTOUT   DD SYSOUT=*,
000010 //             DCB=(RECFM=FB,LRECL=80)
000011 //SYSIN     DD *
000012   SORT FIELDS=COPY
000013   OUTREC FIELDS=(1,2,BI,TO=ZD,LENGTH=8)
****** **************************** Bottom of Data ****************************
to obtain
Code:
********************************* TOP OF DATA **********************************
00049649
******************************** BOTTOM OF DATA ********************************
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Fri Mar 15, 2013 4:47 pm    Post subject:
Reply with quote

Thanks, enrico.
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 ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm


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