DFSORT(sum-sort) - Need 1 step solution?



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

DFSORT(sum-sort) - Need 1 step solution?

Postby onsy.sifer » Wed Apr 16, 2008 4:25 pm

I m having one sequential file with following field.

BI511-DIST-CENTER-NAME
BI511-STATE-NAME
BI511-EXT-CVS-COST
BI511-EXT-CIG-SALES
BI511-EXT-ALC-SALES
BI511-EXT-TOB-SALES
BI511-EXT-GROSS-SALES
BI511-MONTH
BI511-YEAR

I need a one step jcl to do following jobs.
1. Sort the file with field of BI511-DIST-CENTER-NAME(alphanumeric and length is 20) and BI511-STATE-NAME (alphanumeric and length is 20)

2. Sum on following field …
BI511-EXT-CVS-COST
BI511-EXT-CIG-SALES
BI511-EXT-ALC-SALES
BI511-EXT-TOB-SALES
BI511-EXT-GROSS-SALES
Note: all the above fields are alphanumeric with length of 18 where first character as Sign (+ or -), next 13 characters are numeric, next is ‘.’ And rest 3 characters are again numeric.

3. Replace BI511-MONTH (alphanumeric and length is 2) field with spaces.


Thanks...
onsy.sifer
 
Posts: 1
Joined: Wed Apr 16, 2008 3:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DFSORT(sum-sort) - Need 1 step solution?

Postby Frank Yaeger » Wed Apr 16, 2008 11:41 pm

Here's a DFSORT job that will do what you asked for:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  INREC OVERLAY=(41:41,18,SFF,TO=ZD,LENGTH=18,
                 59,18,SFF,TO=ZD,LENGTH=18,
                 77,18,SFF,TO=ZD,LENGTH=18,
                 95,18,SFF,TO=ZD,LENGTH=18,
                 113,18,SFF,TO=ZD,LENGTH=18,
                 2X)
  SORT FIELDS=(1,40,CH,A)
  SUM FORMAT=ZD,FIELDS=(41,18,59,18,77,18,95,18,113,18)
  OUTREC OVERLAY=(41:41,18,ZD,EDIT=(STTTTTTTTTTTTT.TTT),SIGNS=(+,-),
                  59,18,ZD,EDIT=(STTTTTTTTTTTTT.TTT),SIGNS=(+,-),
                  77,18,ZD,EDIT=(STTTTTTTTTTTTT.TTT),SIGNS=(+,-),
                  95,18,ZD,EDIT=(STTTTTTTTTTTTT.TTT),SIGNS=(+,-),
                 113,18,ZD,EDIT=(STTTTTTTTTTTTT.TTT),SIGNS=(+,-))
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post