got wrong data while converting Binary data Zoned decimal



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

got wrong data while converting Binary data Zoned decimal

Postby thotlma » Thu Sep 26, 2019 8:58 pm

HI Every one

As part one my requirmement i need convert the binary data to zoned decimal
i have used below code but i am geeting wrong data in the out put file
could you please help me to sort out issue would be great.

SORT FIELDS=COPY                      
OUTREC FIELDS=(1,6,BI,TO=ZD,LENGTH=14)

Input file
----+--
.gÇm.!
.g¦..!
.g%..!
.g2ÿ..
.g2ÿ..
.g2ÿ..


Out put file

Command ===>
----+----1----
****** **************
000001 00000000000000
000002 00000000000000
000003 00000000000000
000004 00000000000000
000005 00000000000035
000006 00000000000106
000007 00000000000132
thotlma
 
Posts: 25
Joined: Tue Sep 18, 2018 8:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: got wrong data while converting Binary data Zoned decima

Postby enrico-sorichetti » Thu Sep 26, 2019 9:25 pm

You should have posted the hex representation of Your data

ispf HEX ON is Your friend
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: got wrong data while converting Binary data Zoned decima

Postby NicC » Fri Sep 27, 2019 1:24 am

Why post in the Forum Rules?
Topic moved.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: got wrong data while converting Binary data Zoned decima

Postby thotlma » Fri Sep 27, 2019 4:58 pm

enrico-sorichetti wrote:You should have posted the hex representation of Your data

ispf HEX ON is Your friend

input
=COLS> ----+----1----+----2
 004457  qo"                
        09970144444444444444
        086F0400000000000000
 ----------------------------
 004458  qo"
               
        09970144444444444444
        086F0F00000000000000
 ----------------------------
 004459  qo"                
        09970344444444444444
        086F0300000000000000
 ----------------------------
 004460  qo"
               
        09970344444444444444
        086F0D00000000000000




output

=COLS> ----+----1----+----2
004457 00000009999999      
       FFFFFFFFFFFFFF000000
       00000009999999000000
----------------------------
004458 00000009999999      
       FFFFFFFFFFFFFF000000
       00000009999999000000
----------------------------
004459 00000009999999      
       FFFFFFFFFFFFFF000000
       00000009999999000000
----------------------------
004460 00000009999999      
       FFFFFFFFFFFFFF000000
       00000009999999000000
thotlma
 
Posts: 25
Joined: Tue Sep 18, 2018 8:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: got wrong data while converting Binary data Zoned decima

Postby NicC » Fri Sep 27, 2019 5:26 pm

That input looks like 2 packed decimal fields not one binary field.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: got wrong data while converting Binary data Zoned decima

Postby thotlma » Fri Sep 27, 2019 6:09 pm

my requirement to convert input data to numeric data.
the values getting into input as defined comp vaues in cobol prog.
even i tried PD to ZD also please below out put

 =COLS> ----+----1----
 004457 0000098967 001
 004458 0000098967 001
 004459 0000098967 00L
 004460 0000098967 00L
thotlma
 
Posts: 25
Joined: Tue Sep 18, 2018 8:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: got wrong data while converting Binary data Zoned decima

Postby sergeyken » Fri Sep 27, 2019 11:36 pm

thotlma wrote:input
=COLS> ----+----1----+----2
 004457  qo"                
        09970144444444444444
        086F0400000000000000
 ----------------------------
 004458  qo"
               
        09970144444444444444
        086F0F00000000000000
 ----------------------------
 004459  qo"                
        09970344444444444444
        086F0300000000000000
 ----------------------------
 004460  qo"
               
        09970344444444444444
        086F0D00000000000000


1) Your input data do not look like binary (e.g. COMP in COBOL, or BI/FI in SORT).
Rather they do look like packed decimal (e.g. COMP-3 in COBOL, or PD in SORT).

2) From your "files display" it is absolutely not clear how your "files" are related, at all, to your SORT statements example???
Please, present FULL example of your test (simplified as much as possible) to find out the actual processing issues.
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 438
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: got wrong data while converting Binary data Zoned decima

Postby thotlma » Mon Sep 30, 2019 8:02 pm

The acutual input genarating from Cobol Prog and the fields defined in cobol prog as below
XXXXX PIC S9(9) USAGE COMP
XXXXX PIC S9(4) USAGE COMP
i need to convert the above data to numeric format for other process.
i thought it was binary so i wrote a sort to convert ZD but didnot work
could you please help for this one?
thotlma
 
Posts: 25
Joined: Tue Sep 18, 2018 8:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: got wrong data while converting Binary data Zoned decima

Postby Robert Sample » Mon Sep 30, 2019 8:45 pm

Since it is two separate fields, you have to handle each individually in SORT:
SORT FIELDS=COPY                      
OUTREC FIELDS=(1,4,BI,TO=ZD,LENGTH=9,5,2,BI,TO=ZD,LENGTH=5)
Also, if the data set is variable length instead of fixed length, you need to add 4 to each of your locations because of the RDW.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: got wrong data while converting Binary data Zoned decima

Postby thotlma » Mon Sep 30, 2019 10:45 pm

Its working ...Thanks a lot Robert
the data set is fixed length only.
i have some doubts about sort card .why did take length 9 and 5?
never mind if you explain clearly that would be great..
thotlma
 
Posts: 25
Joined: Tue Sep 18, 2018 8:05 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post