! crs_reserve_pu.scp reb, 17-Nov-1858 00:00 .label begin decimal i get #todate=oa$date_nbs:8 get #yr = #todate:4 get #mo = #todate:2:4 get #da = #todate:2:6 compute #da = #da-7 .if #da ges "1" then .goto build_date .label check_day compute #mo=#mo-1 .if #mo ges "1" then .goto add_more_days get #mo = "12" compute #yr=#yr-1 .label add_more_days .if #mo eq 1 or #mo eq 3 or #mo eq 5 or #mo eq 7 - or #mo eq 8 or #mo eq 10 or #mo eq 12 then - compute #da =#da+31 - else .if #mo eq 4 or #mo eq 6 or #mo eq 9 or #mo eq 11 then - compute #da=#da+30 else - compute #da=#da+28 .label build_date .if #da:1:1 eqs "" then get #da="0" #da .if #mo:1:1 eqs "" then get #mo="0" #mo get #tdate=#yr:4 #mo:2 #da:2 .label process get oa$dcl='$ open/write outfile crs_purge.tmp' for crs_reserve with .crs_key:8 les #tdate do - write delete crs_reserve crs_key = .crs_key\\- get oa$dcl='$ write outfile "' .crs_key '"' get oa$dcl='$ close outfile' list crs_purge.tmp delete crs_purge.tmp .label exit_procedure .exit