tldm-universe/Ardent/UV/APP.PROGS/TL.ENABLE.B

182 lines
5.6 KiB
Plaintext
Raw Permalink Normal View History

2024-09-09 21:51:08 +00:00
$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 - Enable Logging
*
* 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.
* 11/10/95 17631 CSM enhance CP+AR mode to remove "stale" tx on reenable
* 03/03/95 15836 CSM if CP,state FULL & log space avail don't ask for sync
* 01/23/95 15836 CSM if CP,state FULL,non-chkpd log;get more space or sync
* 10/21/94 15120 DTM Added checks for 2 new states (Susp/shut in progress)
* 10/20/94 15147 DTM Fixed message
* 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
*******************************************************************************
* Begin processing
*******************************************************************************
CALL *DRAW.SCRN.B( ENBL.MSG0, 1 )
GOSUB init.menu
CALL *MNU.BAR.PR.B( Menu.Bar,1 )
State = ""
RECIO( State, FINFO$AI.STATE, RECIO$FINFO )
IF State = AI$SHUT.PROG OR State = AI$SUSP.PROG THEN
IF State = AI$SHUT.PROG THEN
msg = "Shutdown "
END
ELSE
msg = "Suspend "
END
msg:= "in progress. Cannot be Enabled at this point."
CALL *HELP.BOX.B( 3, 10 ,45, msg )
STOP @(-1)
END
*IF State = AI$LOGGING OR State = AI$INITIAL OR State = AI$WARM.START THEN
* msg = "Logging State is either already Enabled "
* msg := " or in the process of coming up"
* CALL *HELP.BOX.B( 3, 10, 45, msg )
* STOP @(-1)
*END
retry = 1
CALL *HELP.PRINT.B( ENBL.MSG1, 3 )
CALL *YES.NO.BOX.B( 6, ENBL.MSG2, retry )
IF retry THEN
sync = ""
GOSUB check.sync
retry = 1
msg = "Do you wish to retain the existing info file?"
CALL *YES.NO.BOX.B( 6, msg, retry )
IF retry THEN
EXECUTE "ENABLE.RECOVERY YES ":sync CAPTURING Error.Val
END
ELSE
EXECUTE "ENABLE.RECOVERY NO ":sync CAPTURING Error.Val
END
Error.Val = TRIM ( Error.Val )
CALL *HELP.BOX.B( 6, 10, 60, Error.Val )
END
GOTO EXIT
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
***************************************************************************
* check.sync - if CP is ON and in Full state and at least 1 log file's status
* is NeedsSync & no log Avail, then ask user whether to destroy stale tx.
***************************************************************************
check.sync:
IF State NE AI$FULL THEN RETURN
sel.stat = "SELECT UV_LOGS WITH STATUS = Available"
EXECUTE sel.stat CAPTURING junk
IF @SELECTED > 0 THEN RETURN
sel.stat = "SELECT UV_LOGS WITH STATUS = Full"
EXECUTE sel.stat CAPTURING junk
IF @SELECTED > 0 THEN RETURN
OPEN 'DICT', "UV_LOGS" TO uv.log.fp ELSE
CALL *HELP.BOX.B(3,10,45,"Can't open UV_LOGS DICT file" )
STOP @(-1)
END
READ rec FROM uv.log.fp, "CHECKPOINT" THEN
IF rec<2> = "TRUE" THEN
sel.stat = "SELECT UV_LOGS WITH STATUS = NeedsSync"
EXECUTE sel.stat CAPTURING junk
IF @SELECTED > 0 THEN
retry = 0
askagain:
CALL *HELP.PRINT.B(ENBL.MSG7, 3)
CALL *YES.NO.BOX.B(6, ENBL.MSG8, retry)
IF retry THEN
sync = "SYNC"
END
ELSE
CALL *HELP.PRINT.B(ENBL.MSG9, 3)
CALL *YES.NO.BOX.B(6, ENBL.MSG10, retry)
IF retry THEN STOP @(-1)
ELSE GOTO askagain
END
END
END
END
ELSE
CALL *HELP.BOX.B(3,10,45,"Can't read CHECKPOINT from UV_LOGS DICT")
STOP @(-1)
END
CLOSE uv.log.fp
CALL *HELP.PRINT.B("",3)
RETURN
EXIT:
STOP @(-1)
END