ASM1
PROGRAM ASM1(RPAD,TAPE1=RPAD,BC,TAPE10=BC)
C
C ** ROUTINE TO SORT/MERGE RAW PLATO ACCOUNTING DATA
C ** WHICH WAS CREATED BY RAFPBC AND IS ON FILE RPAD
C ** THIS ROUTINE CREATES A FILE BC WHICH IS THE
C ** BILLING CYCLE DATA FOR THE PERIOD
C
EXTERNAL UPDATE
C
REWIND 1
REWIND 10
C
C ** SORT BY
C USER ACCOUNT
C USER COURSE
C USER TYPE
C USER NAME
C LESSON NAME
C LESSON ACCOUNT
C
REWIND 1
REWIND 10
CALL SM5SORT(0)
CALL SM5FROM("RPAD")
CALL SM5TO("BC")
CALL SM5KEY(1,7,"DISPLAY","A")
CALL SM5KEY(9,8,"DISPLAY","A")
CALL SM5KEY(8,1,"DISPLAY","A")
CALL SM5KEY(17,18,"DISPLAY","A")
CALL SM5KEY(35,10,"DISPLAY","A")
CALL SM5KEY(45,7,"DISPLAY","A")
CALL SM5OWN5(UPDATE)
CALL SM5END
REWIND 10
C
C
END
SUBROUTINE UPDATE(IRC,L1,LR1,L2,LR2)
C
C --- SUBROUTINE TO ADD THE TIMES OF TWO RECORDS WITH THE
C --- SAME SORTING KEYS. CALLING SUBROUTINE MUST HAVE AN
C --- *EXTERNAL UPDATE* STATEMENT FOR THIS TO WORK.
C
DIMENSION L1(8), L2(8), NBTWN(6)
C
DECODE (80,10,L1) NBTWN, TIMEA1, TIMEB1
10 FORMAT(5A10,A1,2F10.3)
DECODE (80,11,L2) TIMEA2, TIMEB2
11 FORMAT(51X,2F10.3)
C
TIMEA1 = TIMEA1 + TIMEA2
TIMEB1 = TIMEB1 + TIMEB2
C
ENCODE (80,10,L1) NBTWN, TIMEA1, TIMEB1
C
C SET FLAG TO REPLACE RECORD.
C
IRC = 1
C
RETURN
END