Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SYNCSORT Addition of Zd fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
jk_mf53

New User


Joined: 28 Aug 2008
Posts: 3
Location: India

PostPosted: Wed Sep 17, 2008 7:48 pm    Post subject: SYNCSORT Addition of Zd fields
Reply with quote

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
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2239
Location: @my desk

PostPosted: Wed Sep 17, 2008 8:07 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Sep 18, 2008 3:00 am    Post subject:
Reply with quote

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
View user's profile Send private message
jk_mf53

New User


Joined: 28 Aug 2008
Posts: 3
Location: India

PostPosted: Thu Sep 18, 2008 9:50 am    Post subject:
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2239
Location: @my desk

PostPosted: Thu Sep 18, 2008 10:55 am    Post subject:
Reply with quote

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
View user's profile Send private message
jk_mf53

New User


Joined: 28 Aug 2008
Posts: 3
Location: India

PostPosted: Thu Sep 18, 2008 3:06 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Sep 18, 2008 8:35 pm    Post subject:
Reply with quote

Hello,

Good to hear you have what you need icon_smile.gif

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us