Syncsort - ZD to PD with signs



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Syncsort - ZD to PD with signs

Postby Raj2006 » Wed Oct 23, 2013 4:01 pm

Hi All,

When I tried the below conversion, I expected a negative sign(D) for the 2nd and 3rd.But I am not getting it.

>> When I tried the "TO-PD" --> I GOT 'F' - UNSIGNED POSITIVE
>> After searched our forums, I tried using "TO=PDC" --> I got 'C' signed positive

Could please anyone clarify me? We use SYNCSORT FOR Z/OS 1.4.0.1R.
Input:
0445000
0}57500
0L20000


Sort:
SORT FIELDS=COPY
OUTREC FIELDS=(25,7,ZD,TO=PDC)

 á 
0400
450C
----
 ï&
0550
070C
----
   
0200
300C
Raj2006
 
Posts: 17
Joined: Thu Jul 18, 2013 2:13 pm
Has thanked: 16 times
Been thanked: 0 time

Re: Syncsort - ZD to PD with signs

Postby Akatsukami » Wed Oct 23, 2013 4:12 pm

Note that the negative zones are in position 2; position 7 is positive. Thus, Syncsort interprets the whole as a positive number.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Syncsort - ZD to PD with signs

Postby Raj2006 » Wed Oct 23, 2013 4:28 pm

Dear Akatsukami,

I did not get yours.... could you elaborate it for me?

0}57500 --> 0550
070D - Shouldn't it be?
Raj2006
 
Posts: 17
Joined: Thu Jul 18, 2013 2:13 pm
Has thanked: 16 times
Been thanked: 0 time

Re: Syncsort - ZD to PD with signs

Postby Akatsukami » Wed Oct 23, 2013 7:49 pm

Raj2006 wrote:Dear Akatsukami,

I did not get yours.... could you elaborate it for me?

0}57500 --> 0550
070D - Shouldn't it be?

The string "0}57500"' has a hex value of X'F0D0F5F7F5F0F0'' in EBCDIC. When converting from zoned decimal to packed decimal, the zones (high-order nybbles of each byte) are discarded, except for the zone of the low-order byte, which is used to determine the sign for the number. The low-order byte is X'F0', so the packed decimal number is given a sign of X'F', normalized to X'C'.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Syncsort - ZD to PD with signs

Postby dick scherrer » Wed Oct 23, 2013 9:45 pm

Hello,

0}57500 --> 0550
070D - Shouldn't it be?
No. You need to read about how zoned numbers are stored.

How were these values created? No normal calculation that i know of would cause these results . . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Syncsort - ZD to PD with signs

Postby Akatsukami » Wed Oct 23, 2013 10:02 pm

dick scherrer wrote:How were these values created? No normal calculation that i know of would cause these results . . .

Oh, it's quite simple; Raj-kun is conflating two zoned decimal fields, one of two bytes and one of five.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Syncsort - ZD to PD with signs

Postby dick scherrer » Wed Oct 23, 2013 11:22 pm

Yeah, i wondered about that, but did not know how the "result" was determined with the "}" "helping" with the result . . .

Long week today . . . :?

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Syncsort - ZD to PD with signs

Postby Raj2006 » Wed Oct 23, 2013 11:25 pm

oh...

I confused with this input format. It seems, they come from some assembler program.

But I wanted this to be converted into PD. Is there any other way I can achieve this? Or do you need more info about the input format. Please advice...
Raj2006
 
Posts: 17
Joined: Thu Jul 18, 2013 2:13 pm
Has thanked: 16 times
Been thanked: 0 time

Re: Syncsort - ZD to PD with signs

Postby Raj2006 » Wed Oct 23, 2013 11:58 pm

Again I have tried the below, for the same input...

SORT FIELDS=COPY
OUTREC FIELDS=(26:26,6,ZD,PD,LENGTH=6)

I am able to see this field in file AID as below, but how would I get negative values? FIELD pic is --> S9(09)V99 COMP-3

4450.00
575.00
3200.00

Please advice...
Raj2006
 
Posts: 17
Joined: Thu Jul 18, 2013 2:13 pm
Has thanked: 16 times
Been thanked: 0 time

Re: Syncsort - ZD to PD with signs

Postby Akatsukami » Thu Oct 24, 2013 12:04 am

This gets a little messy, because } is a zoned decimal negative zero, which isn't as straightforward to work with as other negative numbers. However, try this:
  SORT   FIELDS=COPY                                   
  OUTREC IFTHEN=(WHEN=(2,1,BI,GE,208,AND,2,1,BI,LE,217),
           OVERLAY=(1,7,ZD,MUL,-1,TO=PDC)),             
         IFTHEN=(WHEN=NONE,                             
           OVERLAY=(1,7,ZD,MUL,+1,TO=PDC))             
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Next

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post