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
 

 

Addition of numeric field in SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sandip_mainframe
Warnings : 2

New User


Joined: 20 Sep 2006
Posts: 61
Location: pune

PostPosted: Sat Oct 24, 2009 3:20 pm    Post subject: Addition of numeric field in SORT
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: 6967
Location: porcelain throne

PostPosted: Sat Oct 24, 2009 3:43 pm    Post subject:
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: 61
Location: pune

PostPosted: Sat Oct 24, 2009 3:59 pm    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Sat Oct 24, 2009 6:25 pm    Post subject:
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 Moderator


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

PostPosted: Mon Oct 26, 2009 8:54 pm    Post subject:
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:

http://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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL 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 change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


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