I'm hoping to do this either though some type of sort/merge/??? utility or SAS. If I have to I will do it in COBOL but I don't want to go down that route since it has to get implemented ASAP!!!
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Fri Jun 15, 2007 6:34 am Post subject:
DeX,
try this untested control cards. A brief explanation. we add an indicator at the end of the record for all of the records using ifthen and when the CAUSE is 888 then we make the indicator to be zero, so that we can sum all the duplicate records for 888 cause.
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT, *PUT SEQUENCE TO ALL RECS
OVERLAY=(35:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(11,3,ZD,EQ,888), *PUT '00000000' INSTEAD OF
OVERLAY=(35:8C'0')) *SEQUENCE NUM, IF CAUSE IS '888'
SORT FIELDS=(01,06,ZD,A,
11,03,ZD,A,
18,03,ZD,A,
35,08,ZD,A)
*ADD AMOUNT
SUM FIELDS=(22,11,ZD)
OUTREC FIELDS=(1,34)
/*
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum