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
 

 

How to write both SORT and SUM in a single step in JCL

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

New User


Joined: 19 Jan 2007
Posts: 3
Location: Bangalore

PostPosted: Mon Jan 22, 2007 11:16 am    Post subject: How to write both SORT and SUM in a single step in JCL
Reply with quote

How to write both SORT and SUM in a single step in JCL?
Back to top
View user's profile Send private message

manihcl85
Warnings : 1

New User


Joined: 11 Jan 2007
Posts: 52
Location: chennai

PostPosted: Mon Jan 22, 2007 12:08 pm    Post subject:
Reply with quote

what do u mean by SUM here. is it to eliminate duplicates using sum fields = none (or) total
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 Jan 22, 2007 10:12 pm    Post subject:
Reply with quote

Quote:
How to write both SORT and SUM in a single step in JCL?


Just do it. For example:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...
//SORTOUT DD DSN=...
//SYSIN    DD    *
  SORT FIELDS=(21,5,CH,A)
  SUM FIELDS=(5,8,ZD)
/*


The SORT statement specifies the starting position, length, format and collating sequence of the sort field(s).

The SUM statement specifies the starting position, length and format of the sum field(s).

You can use SUM FIELDS=NONE instead of SUM FIELDS=(p,m,f) if that's appropriate.

If there's more to your question, you need to clarify what you're looking for.
Back to top
View user's profile Send private message
tushar_study

New User


Joined: 01 Feb 2007
Posts: 30
Location: Mumbai

PostPosted: Mon Feb 05, 2007 11:20 am    Post subject: Re: How to write both SORT and SUM in a single step in JCL
Reply with quote

I agree with the reply posted,just wanna put forward 1 more fact,may be its is helpful for PadmaPriya that SUM FIELDS=(starting character,number of charactres,datatype(ZD)) will sum all the rows for which the control fields in the SORT CARD are satisfied



Regards,
Tushar
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 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
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm


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