View previous topic :: View next topic
|
Author |
Message |
jk_mf53
New User
Joined: 28 Aug 2008 Posts: 3 Location: India
|
|
|
|
HI,
I need to add two fields containing ZD, the input file is as follows
00022390000000000{ 0000001735{
00022390000000000{ 0000001735{
the sort card i used is as follows
//SYSIN DD *
SORT FIELDS=(1,7,CH,A)
SUM FIELDS=(20,11,ZD)
OMIT COND=(20,11,ZD,LT,0)
/*
The output for this is as follows
00022390000000000{ 00000034700 <- i am getting the value of sign of ZD as zero Can anyone helpin making it correct??
[/quote] |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
jk_mf53,
From the data you provided the input ZD field values are 17350 each which got summed up to give 34700.
Thanks,
Arun |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I believe what you are seeing is that the result of the SUM generated an "F" sign for the positive result rather than a "C" sign. This is usually not a problem as either works correctly when the number is used as a zoned-decimal value.
If you use values that have a negative sum (need to remove the OMIT for the test) you should get a "D" sign for the negative sum. |
|
Back to top |
|
|
jk_mf53
New User
Joined: 28 Aug 2008 Posts: 3 Location: India
|
|
|
|
hi,
Thanks for the reply. The sign is coming when I try to give it as negative[ } ]. Is there any way to display the sign when it is positive? The requirement is such that sign [ { ] should be displayed when it is positive also. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hello,
If you want to dislpay the signs, you can use the EDIT subparameter like this.
Code: |
//SYSIN DD *
SORT FIELDS=(1,7,CH,A)
SUM FIELDS=(20,11,ZD)
OMIT COND=(20,11,ZD,LT,0)
OUTREC FIELDS=(1,19,20,11,ZD,EDIT=(SIIIIIIIIIIT),SIGNS=(+,-,,))
/* |
SORTOUT
Code: |
----+----1----+----2----+----3--
00022390000000000{ +34700 |
Thanks,
Arun |
|
Back to top |
|
|
jk_mf53
New User
Joined: 28 Aug 2008 Posts: 3 Location: India
|
|
|
|
Thanks for the prompt replay. I wanted to be in this format 0000003470} and solved it by using OPTION NZDPRINT in the sort card.
Thanks & Regards,
J.k |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Good to hear you have what you need
Just curious, but if the field is zoned-decimal, why does it make a difference if it is a "C" sign or an "F" sign? |
|
Back to top |
|
|
|