kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Jun 15, 2006 11:08 am Post subject: |
|
|
hsubra,
well there is a way to do what you asked for. But you need to create the friday date file a little different so that we can use it as symnames. Create the firday date file as follows. Any given year will have a min of 52 weeks and max of 53 weeks.
Code: |
FRI01,C'20060106'
FRI02,C'20060113'
FRI03,C'20060120'
FRI04,C'20060127'
FRI05,C'20060203'
FRI06,C'20060210'
FRI07,C'20060217'
FRI08,C'20060224'
FRI09,C'20060303'
FRI10,C'20060310'
FRI11,C'20060317'
FRI12,C'20060324'
FRI13,C'20060331'
FRI14,C'20060407'
FRI15,C'20060414'
....
FRI50,C'20061215'
FRI51,C'20061222'
FRI52,C'20061229'
FRI53,C'20070105'
|
Now we use this file as look up file and modify the dates.I also see that you are summing the AMOUNT values at pos 15. I assumed that your input file has LRECL of 80 and FB recfm dataset.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=your friday date 80 byte file,
// DISP=SHR
//SORTIN DD *
A1B1C1 060104 500.00
A1B1C1 060105 200.00
A1B1C1 060216 100.00
A2B2C2 060607 700.00
A2B2C2 060616 100.00
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(01,06,CH,A,
89,08,CH,A)
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(81:C'20',8,6)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI01),
OVERLAY=(89:FRI01)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI02,AND,81,8,CH,GT,FRI01),
OVERLAY=(89:FRI02)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI03,AND,81,8,CH,GT,FRI02),
OVERLAY=(89:FRI03)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI04,AND,81,8,CH,GT,FRI03),
OVERLAY=(89:FRI04)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI05,AND,81,8,CH,GT,FRI04),
OVERLAY=(89:FRI05)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI06,AND,81,8,CH,GT,FRI05),
OVERLAY=(89:FRI06)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI07,AND,81,8,CH,GT,FRI06),
OVERLAY=(89:FRI07)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI08,AND,81,8,CH,GT,FRI07),
OVERLAY=(89:FRI08)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI09,AND,81,8,CH,GT,FRI08),
OVERLAY=(89:FRI09)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI10,AND,81,8,CH,GT,FRI09),
OVERLAY=(89:FRI10)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI11,AND,81,8,CH,GT,FRI10),
OVERLAY=(89:FRI11)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI12,AND,81,8,CH,GT,FRI11),
OVERLAY=(89:FRI12)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI13,AND,81,8,CH,GT,FRI12),
OVERLAY=(89:FRI13)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI14,AND,81,8,CH,GT,FRI13),
OVERLAY=(89:FRI14)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI15,AND,81,8,CH,GT,FRI14),
OVERLAY=(89:FRI15)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI16,AND,81,8,CH,GT,FRI15),
OVERLAY=(89:FRI16)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI17,AND,81,8,CH,GT,FRI16),
OVERLAY=(89:FRI17)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI18,AND,81,8,CH,GT,FRI17),
OVERLAY=(89:FRI18)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI19,AND,81,8,CH,GT,FRI18),
OVERLAY=(89:FRI19)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI20,AND,81,8,CH,GT,FRI19),
OVERLAY=(89:FRI20)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI21,AND,81,8,CH,GT,FRI20),
OVERLAY=(89:FRI21)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI22,AND,81,8,CH,GT,FRI21),
OVERLAY=(89:FRI22)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI23,AND,81,8,CH,GT,FRI22),
OVERLAY=(89:FRI23)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI24,AND,81,8,CH,GT,FRI23),
OVERLAY=(89:FRI24)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI25,AND,81,8,CH,GT,FRI24),
OVERLAY=(89:FRI25)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI26,AND,81,8,CH,GT,FRI25),
OVERLAY=(89:FRI26)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI27,AND,81,8,CH,GT,FRI26),
OVERLAY=(89:FRI27)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI28,AND,81,8,CH,GT,FRI27),
OVERLAY=(89:FRI28)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI29,AND,81,8,CH,GT,FRI28),
OVERLAY=(89:FRI29)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI30,AND,81,8,CH,GT,FRI29),
OVERLAY=(89:FRI30)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI31,AND,81,8,CH,GT,FRI30),
OVERLAY=(89:FRI31)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI32,AND,81,8,CH,GT,FRI31),
OVERLAY=(89:FRI32)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI33,AND,81,8,CH,GT,FRI32),
OVERLAY=(89:FRI33)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI34,AND,81,8,CH,GT,FRI33),
OVERLAY=(89:FRI34)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI35,AND,81,8,CH,GT,FRI34),
OVERLAY=(89:FRI35)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI36,AND,81,8,CH,GT,FRI35),
OVERLAY=(89:FRI36)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI37,AND,81,8,CH,GT,FRI36),
OVERLAY=(89:FRI37)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI38,AND,81,8,CH,GT,FRI37),
OVERLAY=(89:FRI38)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI39,AND,81,8,CH,GT,FRI38),
OVERLAY=(89:FRI39)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI40,AND,81,8,CH,GT,FRI39),
OVERLAY=(89:FRI40)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI41,AND,81,8,CH,GT,FRI40),
OVERLAY=(89:FRI41)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI42,AND,81,8,CH,GT,FRI41),
OVERLAY=(89:FRI42)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI43,AND,81,8,CH,GT,FRI42),
OVERLAY=(89:FRI43)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI44,AND,81,8,CH,GT,FRI43),
OVERLAY=(89:FRI44)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI45,AND,81,8,CH,GT,FRI44),
OVERLAY=(89:FRI45)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI46,AND,81,8,CH,GT,FRI45),
OVERLAY=(89:FRI46)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI47,AND,81,8,CH,GT,FRI46),
OVERLAY=(89:FRI47)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI48,AND,81,8,CH,GT,FRI47),
OVERLAY=(89:FRI48)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI49,AND,81,8,CH,GT,FRI48),
OVERLAY=(89:FRI49)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI50,AND,81,8,CH,GT,FRI49),
OVERLAY=(89:FRI50)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI51,AND,81,8,CH,GT,FRI50),
OVERLAY=(89:FRI51)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI52,AND,81,8,CH,GT,FRI51),
OVERLAY=(89:FRI52)),
IFTHEN=(WHEN=(81,8,CH,LE,FRI53,AND,81,8,CH,GT,FRI52),
OVERLAY=(89:FRI53))
OUTREC FIELDS=(01,07,91,06,14,67,1,6,89,8)
OUTFIL OUTREC=(1,80),
REMOVECC,NODETAIL,
SECTIONS=(81,14,
TRAILER3=(01,14,
TOT=(15,6,UFF,EDIT=(IIIIIIIT.TT)),
80:X))
/*
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|