Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
Warnings : 2

New User

Joined: 19 Jan 2007
Posts: 3
Location: Bangalore

 Posted: Mon Jan 22, 2007 11:16 am    Post subject: How to write both SORT and SUM in a single step in JCL How to write both SORT and SUM in a single step in JCL?

manihcl85
Warnings : 1

New User

Joined: 11 Jan 2007
Posts: 52
Location: chennai

 Posted: Mon Jan 22, 2007 12:08 pm    Post subject: what do u mean by SUM here. is it to eliminate duplicates using sum fields = none (or) total
Frank Yaeger

DFSORT Moderator

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

Posted: Mon Jan 22, 2007 10:12 pm    Post subject:

 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.
tushar_study

New User

Joined: 01 Feb 2007
Posts: 30
Location: Mumbai

 Posted: Mon Feb 05, 2007 11:20 am    Post subject: Re: How to write both SORT and SUM in a single step in JCL 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
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us