.; CALEND.CMD - MAINTAIN CALENDAR FOR USERS
.ENABLE SUBSTITUTION
.ENABLE GLOBAL
.ENABLE QUIET
.SETS UDATE P1
.IF UDATE NE "DELETE" .GOTO LBV3
.ASK CONFM DELETE ALL CALENDAR MESSAGES- ARE YOU SURE?
.IFF CONFM .GOTO EXIT
PIP CALEND.TIK;*/DE/NM
.GOTO EXIT
.LBV3:
.IF UDATE NE "ALL" .GOTO LLV0
.SETN NOW 1
.GOTO LLV
.LLV0:
.SETS UDD P1[3:3]
.IF UDD NE "-" .SETS UDATE <DATE>
.GOSUB NUMDAT
.SETN NOW UNUMB
.; HERE DO OUR OPERATION - NUMBER "NOW" HAS A DATE NUMBER
.; NAME THIS THE QUERY OPERATION TO LOOK THRU A TICKLER FILE
.; TO SEE WHAT MESSAGES TO PRINT FOR TODAY
.LLV:
.TESTFILE SY:CALEND.TIK
.IF <FILERR> NE 1 .GOTO EXIT
.; IF WE GET HERE, THERE'S A CALENDAR FILE THERE TO EXAMINE.
.SETN $NOW NOW
.CHAIN CALEND.TIK
.GOTO EXIT
.; NUMDAT - COMPUTE A NUMBER FROM A DATE IN SYMBOL "UDATE".
.; RETURN VALUE IN UNUMB
.NUMDAT:
.SETS UYR UDATE[10:11]
.SETN YR 'UYR'.-80.
.SETN YR YR*32.*12.
.SETS UMMM UDATE[4:6]
.IF UMMM EQ "JAN" .SETN MMM 1
.IF UMMM EQ "FEB" .SETN MMM 2
.IF UMMM EQ "MAR" .SETN MMM 2
.IF UMMM EQ "APR" .SETN MMM 4
.IF UMMM EQ "MAY" .SETN MMM 5
.IF UMMM EQ "JUN" .SETN MMM 6
.IF UMMM EQ "JUL" .SETN MMM 7
.IF UMMM EQ "AUG" .SETN MMM 8.
.IF UMMM EQ "SEP" .SETN MMM 9.
.IF UMMM EQ "OCT" .SETN MMM 10.
.IF UMMM EQ "NOV" .SETN MMM 11.
.IF UMMM EQ "DEC" .SETN MMM 12.
.SETN MMM MMM*32.
.SETS UDD UDATE[1:2]
.SETN DD 'UDD'.-1
.SETN UNUMB YR+MMM+DD
.RETURN
.EXIT:
