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

Addition of numeric field in SORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sandip_mainframe
Warnings : 2

New User


Joined: 20 Sep 2006
Posts: 63
Location: pune

PostPosted: Sat Oct 24, 2009 3:20 pm
Reply with quote

Hi,
I want to do addition of field which is numeric(E-SALARY).

data in input file --
Code:

E-ID        E-NAME   E-DEPT  E-SALARY
21700      RAJESH   CHEM    20000
22000      SANDIP   CHEM    30000
21900      SHYAM    COMP    30000
21500      MANISH   IT      30000
21500      TUSHAR   IT      30000
21400      SANDIP   MECH    20000
21800      RAJESH   MECH    30000
21600      TUSHAR   MECH    30000


I want to addtion of E-SALARY field on the basis of E-DEPT field in sort. I tried following options but the job is getting abended.

Code:

  SORT FIELDS=(17,04,CH,A)
  SUM FIELDS=(19,05,CH)   

  SORT FIELDS=(17,04,CH,A)
  SUM FIELDS=(19,05,ZD)   

  SORT FIELDS=(17,04,CH,A)
  SUM FIELDS=(19,05,PD)   

  SORT FIELDS=(17,04,CH,A)
  SUM FIELDS=(19,05,BI)   


Thanks,
Sandip Walsinge

Edited by Expat to use bb code tags
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Oct 24, 2009 3:43 pm
Reply with quote

Sandip Walsinge,

If you would use BBCode ,
we would know if E-Salary is always in the same relative location
or if it is variably placed based on variable lengths of E-NAME and E-DEPT.

also include, record format, record length, expected output.
Back to top
View user's profile Send private message
sandip_mainframe
Warnings : 2

New User


Joined: 20 Sep 2006
Posts: 63
Location: pune

PostPosted: Sat Oct 24, 2009 3:59 pm
Reply with quote

Hi Dick,
Thanks for instant reply. My job ran successfully. The error was with starting position of E-DEPT.

The sort card wordked is like this -

Code:

   SORT FIELDS=(14,04,CH,A)   
   SUM FIELDS=(19,05),FORMAT=ZD


Thnaks,
Sandip Walsinge
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Oct 24, 2009 6:25 pm
Reply with quote

glad I was 'able to help' and you were able to find your solution.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Oct 26, 2009 8:54 pm
Reply with quote

Sandip,

You can't just guess at the format. You have to use the correct format for the type of data you're working with. In this case, the correct format for the E-SALARY field is ZD so that's what you have to use.

For details on all of the DFSORT formats, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA40/C.0?DT=20090527161936
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top