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

Syncsort - Sum fields with decimal.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jan 18, 2011 7:39 pm
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

Moderator Emeritus


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

PostPosted: Tue Jan 18, 2011 9:14 pm
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
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: 2481
Location: @my desk

PostPosted: Wed Jan 19, 2011 2:06 pm
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
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

Moderator Emeritus


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

PostPosted: Wed Jan 19, 2011 10:29 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Need Help with Packed Decimal Signs DFSORT/ICETOOL 4
No new posts Select a DB2 value in a specific deci... DB2 4
No new posts String has hex character need to conv... COBOL Programming 3
Search our Forums:

Back to Top