205 lines
5.8 KiB
Plaintext
Executable File
205 lines
5.8 KiB
Plaintext
Executable File
$INCLUDE UNIVERSE.INCLUDE MTF.INCL.H
|
|
$INCLUDE UNIVERSE.INCLUDE FILENAMES.H
|
|
$INCLUDE UNIVERSE.INCLUDE MACHINE.NAME
|
|
$INCLUDE UNIVERSE.INCLUDE TLOG.H
|
|
******************************************************************************
|
|
*
|
|
* System Admin Transaction Logging - Purge Old Files
|
|
*
|
|
* Module %M% Version %I% Date %H%
|
|
*
|
|
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
|
|
* This is unpublished proprietary source code of Ardent Software Inc.
|
|
* The copyright notice above does not evidence any actual or intended
|
|
* publication of such source code.
|
|
*
|
|
*******************************************************************************
|
|
*
|
|
* Maintenence log - insert most recent change descriptions at top
|
|
*
|
|
* Date.... GTAR# WHO Description........................................
|
|
* 10/14/98 23801 SAP Change copyrights.
|
|
* 08/22/94 14725 DTM Added STOP @(-1)
|
|
* 07/18/94 13286 DTM Made it remove blank FULL.DATE files as well
|
|
* 05/15/94 13286 DTM Initial programming
|
|
*
|
|
*******************************************************************************
|
|
id = "%W%"
|
|
*******************************************************************************
|
|
|
|
*******************************************************************************
|
|
* Call initialization routines
|
|
*******************************************************************************
|
|
TPRINT @(-1)
|
|
temp = NULL
|
|
CALL *ISUSER.B(0, temp)
|
|
IF temp = 0 THEN
|
|
TPRINT UVREADMSG(071000,"")
|
|
SLEEP 3
|
|
STOP
|
|
END
|
|
GOSUB init.form
|
|
CALL *DRAW.SCRN.B( PRG.MSG0 ,1 )
|
|
GOSUB init.menu
|
|
CALL *MNU.BAR.PR.B( Menu.Bar,1 )
|
|
|
|
*******************************************************************************
|
|
* Begin processing
|
|
*******************************************************************************
|
|
|
|
CALL *HELP.PRINT.B( UVREADMSG( 073009,"" ), 2 )
|
|
CALL *PUT.FORM.B( form.size, form, temp.form, PRMPT, 1 )
|
|
|
|
help.loop:
|
|
|
|
CALL *HELP.PRINT.B( form< form.line, 4 >, 1 )
|
|
|
|
input.loop:
|
|
|
|
TPRINT form<1,2>:
|
|
temp=temp.form<form.line>
|
|
CALL *CINPUT.B(SEC.PRMPT,temp,special,form<form.line,6>,0)
|
|
|
|
IF special # 0 THEN
|
|
BEGIN CASE
|
|
CASE special = F.1
|
|
CALL *HELP.PRINT.B(form<1,5>,3)
|
|
GOTO input.loop
|
|
CASE special = ESCAPE
|
|
STOP @(-1)
|
|
CASE special = F.10
|
|
action.value=1
|
|
CALL *DO.MNU.BAR.B(Menu.Bar,action.value,form.size,form,temp.form)
|
|
BEGIN CASE
|
|
CASE action.value = 1
|
|
STOP @(-1)
|
|
CASE action.value = 2
|
|
STOP @(-1)
|
|
CASE action.value = 3
|
|
message=PRG.MSG3
|
|
CONVERT @FM TO " " IN message
|
|
CALL *HELP.BOX.B(3,10,60,message)
|
|
CASE action.value = 4
|
|
message=UVREADMSG(076001,"")
|
|
CONVERT @FM TO " " IN message
|
|
CALL *HELP.BOX.B(3,10,60,message)
|
|
CASE action.value = 5
|
|
CALL *HELP.BOX.B(3,10,45,UVREADMSG(076000,""))
|
|
END CASE
|
|
CALL *PUT.FORM.B(form.size,form,temp.form,PRMPT,1)
|
|
GOTO help.loop
|
|
CASE 1
|
|
GOTO input.loop
|
|
END CASE
|
|
END
|
|
ELSE ;* Valid Data Entered
|
|
IF ( temp NE NULL ) THEN
|
|
IF ( temp MATCHES '2n/2n/0n') THEN
|
|
temp.form< 1 > = temp
|
|
Date = temp
|
|
GOSUB Purge.Old.Logs
|
|
END
|
|
ELSE
|
|
msg = "Date must match the MM/DD/YY format"
|
|
temp.form<1> = ""
|
|
CALL *HELP.BOX.B(11,10,45,msg)
|
|
CALL *PUT.FORM.B(form.size,form,temp.form,PRMPT,1)
|
|
GOTO help.loop
|
|
END
|
|
END
|
|
ELSE
|
|
GOTO input.loop
|
|
END
|
|
END
|
|
STOP @(-1)
|
|
|
|
*************************************************************************
|
|
* Init.form
|
|
* This routine is used TO initialize the form TO be printed on the
|
|
* screen for data input. It also sets up the default answers, if
|
|
* any
|
|
*
|
|
*************************************************************************
|
|
init.form:
|
|
form = NULL
|
|
temp.form = NULL
|
|
DT = DATE()
|
|
temp.form<1>= OCONV(DT, "D2/")
|
|
form<1,1> = @(5,9)
|
|
form<1,2> = @(35,9)
|
|
form<1,3> = PRG.MSG1
|
|
form<1,4> = PRG.MSG2
|
|
form<1,5> = form<1,4>
|
|
form<1,6> = 10
|
|
form.size = 1
|
|
form.line = 1
|
|
RETURN
|
|
|
|
***************************************************************************
|
|
* Purge Old Logs
|
|
***************************************************************************
|
|
Purge.Old.Logs:
|
|
|
|
msg2 = "Old Log Files Purged"
|
|
retry = 1
|
|
CALL *HELP.PRINT.B( PURG.MSG1, 3 )
|
|
CALL *YES.NO.BOX.B( 11, PURG.MSG2, retry )
|
|
IF retry THEN
|
|
CURR.DATE = ICONV( Date, "D" )
|
|
SEL.DATE = OCONV( CURR.DATE, "D2/" )
|
|
SEL.STAT = "SSELECT UV_LOGS WITH STATUS = Released AND FULL.DATE < ":SEL.DATE
|
|
EXECUTE SEL.STAT RTNLIST tmpl CAPTURING junk
|
|
lping = 1
|
|
counter = 0
|
|
LOOP
|
|
READNEXT temp2 FROM tmpl THEN
|
|
DEL.STATE = "DELETE UV_LOGS ":temp2
|
|
EXECUTE DEL.STATE CAPTURING junk
|
|
counter += 1
|
|
END
|
|
ELSE lping = 0
|
|
UNTIL lping = 0 REPEAT
|
|
msg = counter:PURG.MSG3
|
|
CALL *HELP.BOX.B(17,5,50, msg)
|
|
END
|
|
|
|
RETURN
|
|
|
|
***************************************************************************
|
|
* init.menu - initializes menu bar
|
|
***************************************************************************
|
|
init.menu:
|
|
scratch=UVREADMSG(073087,"")
|
|
Menu.Bar = NULL
|
|
Menu.Bar<1,1> = 3 ;* Number of Items in Menu.Bar
|
|
Menu.Bar<1,2> = 1 ;* Line # on which to print the Menu Bar
|
|
* First Item
|
|
Menu.Bar<2,1,1>=scratch<1> ;* SubMenu Title
|
|
Menu.Bar<2,1,2>=1 ;* # of items in SubMenu
|
|
* SubMenu #1
|
|
Menu.Bar<2,2,1>=scratch<6> ;* SubMenu Item
|
|
Menu.Bar<2,2,2>=1 ;* Action Code (Returned to calling process)
|
|
Menu.Bar<2,2,3>=scratch<7>
|
|
* Second Item
|
|
Menu.Bar<3,1,1>=scratch<8> ;* SubMenu Title
|
|
Menu.Bar<3,1,2>=1 ;* # of items in SubMenu
|
|
* SubMenu #1
|
|
Menu.Bar<3,2,1>=scratch<6> ;* SubMenu Item
|
|
Menu.Bar<3,2,2>=2 ;* Action Code
|
|
Menu.Bar<3,2,3>=scratch<7>
|
|
scratch=UVREADMSG(073089,"")
|
|
Menu.Bar<4,1,1>=scratch<1>
|
|
Menu.Bar<4,1,2>=3
|
|
Menu.Bar<4,2,1>=scratch<2>
|
|
Menu.Bar<4,2,2>=3
|
|
Menu.Bar<4,2,3>=scratch<3>
|
|
Menu.Bar<4,3,1>=scratch<4>
|
|
Menu.Bar<4,3,2>=4
|
|
Menu.Bar<4,3,3>=scratch<5>
|
|
Menu.Bar<4,4,1>=scratch<6>
|
|
Menu.Bar<4,4,2>=5
|
|
Menu.Bar<4,4,3>=scratch<7>
|
|
RETURN
|
|
STOP @(-1)
|
|
END
|