IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SYNCSORT Addition of Zd fields


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 2481
Location: @my desk

PostPosted: Wed Sep 17, 2008 8:07 pm
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

Moderator Emeritus


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

PostPosted: Thu Sep 18, 2008 3:00 am
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
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: 2481
Location: @my desk

PostPosted: Thu Sep 18, 2008 10:55 am
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
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

Moderator Emeritus


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

PostPosted: Thu Sep 18, 2008 8:35 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
Search our Forums:

Back to Top