View previous topic :: View next topic
|
Author |
Message |
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
for example, I want to convert a S9(9) COMP data into a 9(9) data, how to do this via DFSort?
before conversion:
after conversion:
Code: |
000000009
FFFFFFFFF
000000009
|
before conversion:
after conversion:
Code: |
0000000010
FFFFFFFFFF
0000000010
|
thanks for your help in advance. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
shame on You
after five years of hanging around and You still use the wrong terminology ...
HEX vs BINARY
from
to ( 8 is an arbitrary length NOT related to the original data )
Code: |
00000010
ffffffff
00000010
|
is a numeric conversion
from
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
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
before conversion:
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 |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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
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 |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
Thanks, enrico. |
|
Back to top |
|
|
|