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 - Sum fields with decimal.

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

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Tue Jan 18, 2011 6:45 pm    Post subject: Syncsort - Sum fields with decimal.
Reply with quote

I have a following requirement for which I need some help.

1. I have to do a sum fields operation on the following fields of an input flat file of LRECL 975/FB.

The fields are declared like:

Code:
   
 20 EDIX-PREM(1)                  S9(7).99     100    470     479      10
 20 EDIX-ALLOW(1)                S9(7).99     101    480     489      10


In file-aid they look like:

Code:
EDIX-PREM(1) EDIX-ALLOW(1)
10/SNUM      10/SNUM       
(470-479)    (480-489)     
100--------- 101----------
      158.12             0
      213.70             0
       20.94          2.93
      -46.54         -6.52
     -461.01        -64.54
      -31.16         -4.36
       16.91          2.37
      -33.81         -4.73
     -135.00        -13.50
      -42.50         -5.95
     -384.00        -38.40
       80.00          8.00
      -80.00         -8.00
     -174.00        -17.40
      -88.00        -12.32
       32.90          4.61


In 3.4 they look like (EDIX-PREM1):

Code:
7----+----
000015812+
000021370+
000002094+
000004654-
000046101-
000003116-
000001691+
000003381-
000013500-
000004250-
000038400-
000008000+
000008000-
000017400-
000008800-
000003290+


I am not getting the why the edited decimal is not showing in 3.4!!

However, I am using a below sort card which is giving a SOC7 abend...because of the sign may be. I have an idea of splitting the file into two by their signs...sum them up...then match them by (1,3,CH,A) and get the correct resultant sum. Is this approach fine or there is some other way out??

Code:

 //SYSIN     DD *                                                       
 INREC  FIELDS=(1,476,478,2,480,7,488,2,490,486)                       
 SORT   FIELDS=(1,3,CH,A)                                               
 OMIT COND=(1,1,CH,EQ,C'#',OR,64,2,CH,NE,C'MA',OR,42,8,ZD,GT,20101231)
 SUM    FIELDS=(470,9,480,9),FORMAT=ZD                                 
 OUTREC FIELDS=(1,476,C'.',477,2,479,7,C'.',486,2,488,486)             
/*                                                                     
Back to top
View user's profile Send private message

ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Tue Jan 18, 2011 7:34 pm    Post subject:
Reply with quote

I am using SYNCSORT.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8118
Location: East Dubuque, Illinois, USA

PostPosted: Tue Jan 18, 2011 7:39 pm    Post subject:
Reply with quote

The V in a PICTURE clause in COBOL means implied decimal point. "Implied decimal point" means there is no actual decimal point -- but COBOL will process the data as if there were a decimal point there.

You don't see the decimal point in the file because it is not there -- it is implied only. File Aid will use an actual decimal point when displaying data with an implied decimal point.
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: Tue Jan 18, 2011 9:14 pm    Post subject:
Reply with quote

Hello,

The 0c7 is because the data is not zoned-decimal.

Suggest you read about SFF in the documentation.
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Wed Jan 19, 2011 1:45 pm    Post subject:
Reply with quote

Hi,

Yes the decimal is implied and the fields are not zoned decimal.

Below are their declarations:

Code:
000139                10  EDIX-PREMIUMS.                                 
000140                    15  FILLER               OCCURS 6 TIMES.       
000141                        20  EDIX-PREM           PIC S9(07)V99     
000142                            SIGN IS TRAILING SEPARATE CHARACTER.   
000143                        20  EDIX-ALLOW          PIC S9(07)V99     
000144                            SIGN IS TRAILING SEPARATE CHARACTER.   


now, this trailing sign(edited format) is giving me trouble while summing them up.

Could you please suggest a suitable way to write the sort card...will edit masks help??? Please advice.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Jan 19, 2011 2:06 pm    Post subject:
Reply with quote

dick scherrer wrote:
Suggest you read about SFF in the documentation
Did you follow the advice already given to you?
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Wed Jan 19, 2011 3:38 pm    Post subject:
Reply with quote

Hi,

Could you please give me the link or let me know which documentation. I tried searching it but could not find anything matching...
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: Wed Jan 19, 2011 10:29 pm    Post subject:
Reply with quote

Hello,

Quote:
Could you please give me the link or let me know which documentation.
There is plenty of information in the Syncsort Programmer's Guide (i'm looking at the 1.3 release).

There are also some topics in our forum. You might search the JCL part of the forum looking for examples of what you want to do. I suggest the JCL part of the forum because this is where Syncsort topics are posted.
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 How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am


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