Page 1 of 1

Sort sum with a zoned field

PostPosted: Fri Jun 02, 2017 11:36 pm
by xcspg3
Hi,
I can't understand how the sum of positive fields gives an unsigned result. Only the sum of negative fields is signed field.

The sysin is
//SYSIN    DD *                  
 SORT FIELDS=(1,125,CH,A)        
 SUM FIELDS=(126,15,ZD)  


The sum of this 3 records is positive and the field is unsigned
                                                   Columns 00069 00140
-7----+----8----+----9----+----0----+----1----+----2----+----3----+----4
062016-05-052015-06-250000-00-00ALTRE     00000000227734F00000000000041C
FFFFFF6FF6FFFFFF6FF6FFFFFF6FF6FFCDEDC44444FFFFFFFFFFFFFFCFFFFFFFFFFFFFFC
062016005005201500602500000000001339500000000000002277346000000000000413
-----------------------------------------------------------------------
062016-05-052015-06-250000-00-00ALTRE     00000000227734F00000000000103B
FFFFFF6FF6FFFFFF6FF6FFFFFF6FF6FFCDEDC44444FFFFFFFFFFFFFFCFFFFFFFFFFFFFFC
062016005005201500602500000000001339500000000000002277346000000000001032
-----------------------------------------------------------------------
062016-05-052015-06-250000-00-00ALTRE     00000000227734F00000000002855E
FFFFFF6FF6FFFFFF6FF6FFFFFF6FF6FFCDEDC44444FFFFFFFFFFFFFFCFFFFFFFFFFFFFFC
062016005005201500602500000000001339500000000000002277346000000000028555


                                                    Columns 00069 00140
-7----+----8----+----9----+----0----+----1----+----2----+----3----+----4
062016-05-052015-06-250000-00-00ALTRE     00000000227734F000000000030000
FFFFFF6FF6FFFFFF6FF6FFFFFF6FF6FFCDEDC44444FFFFFFFFFFFFFFCFFFFFFFFFFFFFFF
062016005005201500602500000000001339500000000000002277346000000000030000
 


The sum of this 2 records is negative and the field is signed
                                                   Columns 00069 00140
-7----+----8----+----9----+----0----+----1----+----2----+----3----+----4
002009-12-102007-10-112009-12-14ALTRE     00000000374109E00000000008442Q
FFFFFF6FF6FFFFFF6FF6FFFFFF6FF6FFCDEDC44444FFFFFFFFFFFFFFCFFFFFFFFFFFFFFD
002009012010200701001120090120141339500000000000003741095000000000084428
-----------------------------------------------------------------------
002009-12-102007-10-112009-12-14ALTRE     00000000374109E00000000009329P
FFFFFF6FF6FFFFFF6FF6FFFFFF6FF6FFCDEDC44444FFFFFFFFFFFFFFCFFFFFFFFFFFFFFD
002009012010200701001120090120141339500000000000003741095000000000093297

                                                    Columns 00069 00140
-7----+----8----+----9----+----0----+----1----+----2----+----3----+----4
002009-12-102007-10-112009-12-14ALTRE     00000000374109E00000000017772N
FFFFFF6FF6FFFFFF6FF6FFFFFF6FF6FFCDEDC44444FFFFFFFFFFFFFFCFFFFFFFFFFFFFFD
002009012010200701001120090120141339500000000000003741095000000000177725
 


Can you help me?
Thanks

Re: Sort sum with a zoned field

PostPosted: Sat Jun 03, 2017 12:12 am
by Akatsukami
Try adding a

OPTION NZDPRINT
 

card to your control deck.

Re: Sort sum with a zoned field

PostPosted: Sat Jun 03, 2017 12:50 am
by enrico-sorichetti
review your understanding of negative/positive zoned representation
also remember , the concept of signed/unsigned applies usually ONLY to the binary integer representation
in 32 bits You can represent a 2**31 SIGNED number or a 2**32 UNSIGNED numnber

Re: Sort sum with a zoned field

PostPosted: Mon Jun 05, 2017 1:35 pm
by xcspg3
Your suggestion is ok
thanks a lot
max

Re: Sort sum with a zoned field

PostPosted: Thu Jun 22, 2017 11:01 pm
by vinayjai
Akatsukami wrote:Try adding a

OPTION NZDPRINT
 

card to your control deck.


thanks for this info. But how to fix the same issue with OUTREC instead of sum fields ?

OUTREC FIELDS=(1:1,643,644:361,15,ZD,ADD,391,15,ZD,M11,LENGTH=15) ->>> the value created at 644 having F0 instead of C0

Re: Sort sum with a zoned field

PostPosted: Fri Jun 23, 2017 1:20 am
by vinayjai
I resolved the issue usingTO=ZDC:
OUTREC FIELDS=(1:1,643,644:361,15,ZD,ADD,391,15,ZD,TO=ZDC,LENGTH=15)

Re: Sort sum with a zoned field

PostPosted: Fri Jun 23, 2017 2:02 am
by NicC
vinayjai - please do not tailgate other peoples topics. In future, start you own topic.