165 lines
4.7 KiB
Brainfuck
Executable File
165 lines
4.7 KiB
Brainfuck
Executable File
******************************************************************************
|
|
*
|
|
* System Admin Transaction Logging - Routine to set the Logging State
|
|
*
|
|
* 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.
|
|
* 05/24/95 16198 GMH Allow reconfigure of tape devices on FULL TAPE
|
|
* 05/19/95 16198 GMH Correct chkpoint off
|
|
* 05/04/95 16198 GMH Set CHKPOINT OFF if DEVICELIST given
|
|
* 04/26/95 16198 GMH Add archive tape support
|
|
* 10/27/94 15220 DTM Added descriptive messages
|
|
* 10/14/94 15104 DTM Fixed to verify number of prompts
|
|
* 05/15/94 13286 DTM Initial programming
|
|
*
|
|
*******************************************************************************
|
|
id = "%W%"
|
|
*******************************************************************************
|
|
$INCLUDE UNIVERSE.INCLUDE TLOG.H
|
|
$INCLUDE UNIVERSE.INCLUDE MTF.INCL.H
|
|
|
|
EQU CP TO "CHECKPOINT"
|
|
EQU AR TO "ARCHIVE"
|
|
EQU DV TO "DEVICELIST"
|
|
|
|
* Open &DEVICES& file
|
|
open '&DEVICE&' to DEVICE.FILE else
|
|
* Unable to open x file, aborting
|
|
print UVREADMSG(001520,"&DEVICE&")
|
|
stop
|
|
end
|
|
|
|
* Get current state
|
|
State = ""
|
|
RECIO( State, FINFO$AI.STATE, RECIO$FINFO )
|
|
|
|
proceed = 0
|
|
* Check if full
|
|
ARX=''
|
|
if State = AI$FULL then
|
|
RECIO( ARX, FINFO$AI.ARCHIVE.TAPE, RECIO$FINFO )
|
|
if ARX = 4 then proceed = 1
|
|
end
|
|
|
|
* go
|
|
IF State = AI$UNINIT OR State = AI$DISABLED OR State = AI$SUSPENDED OR State = AI$INACTIVE OR proceed THEN
|
|
counter = 2
|
|
CPToken = -1
|
|
ARToken = -1
|
|
DVToken = -1
|
|
END
|
|
ELSE
|
|
PRINT SFILE.MSG2
|
|
STOP
|
|
END
|
|
|
|
DEVICELIST=""
|
|
TMP = TRIM( @SENTENCE )
|
|
ARGC = DCOUNT( TMP, " " )
|
|
IF ( ARGC < 2 ) THEN
|
|
*PRINT "Error: Incorrect number of arguments"
|
|
print UVREADMSG(001748,"")
|
|
STOP
|
|
END
|
|
|
|
LOOP
|
|
Token = UPCASE( FIELD( @SENTENCE, " ", counter ) )
|
|
counter += 1
|
|
BEGIN CASE
|
|
* Checkpoint keyword
|
|
CASE Token = CP
|
|
Tmp = UPCASE( FIELD( @SENTENCE, " ", counter ) )
|
|
CPToken = IF Tmp = "ON" THEN 1 ELSE 0
|
|
counter += 1
|
|
* Archive keyword
|
|
CASE Token = AR
|
|
Tmp = UPCASE( FIELD( @SENTENCE, " ", counter ) )
|
|
ARToken = IF Tmp = "ON" THEN 1 ELSE 0
|
|
counter += 1
|
|
* Devicelist keyword
|
|
CASE Token = DV
|
|
DVtoken = 1
|
|
* Assume archive on
|
|
ARtoken = 1
|
|
CASE 1
|
|
* If set, collect devices to end of loop or until
|
|
* another keyword is seen
|
|
IF DVtoken > 0 THEN
|
|
* Check for valid device
|
|
read devrec from DEVICE.FILE, Token THEN
|
|
* Check for tape type
|
|
if devrec<4> = "DT" or devrec<4> = "DC" then
|
|
* Now check existing device list
|
|
locate(Token,DEVICELIST,1;POS) then
|
|
* Duplicate device %s removed from list.
|
|
print UVREADMSG(087268,Token)
|
|
end else
|
|
* Looks good, add to list
|
|
DEVICELIST<1,-1> = Token
|
|
end
|
|
end else
|
|
* x is an invalid device type
|
|
print UVREADMSG(073603,Token:" (":devrec<4>:")")
|
|
end
|
|
end
|
|
END ELSE
|
|
* Junk
|
|
PRINT "Invalid Argument '":Token:"'."
|
|
STOP
|
|
END
|
|
END CASE
|
|
WHILE counter <= ARGC
|
|
REPEAT
|
|
|
|
* If DEVICES, make certain Checkpoint is OFF
|
|
if DVToken > 0 AND CPToken THEN CPToken = 0
|
|
|
|
* Set Checkpoint
|
|
IF CPToken # -1 THEN
|
|
RECIO( RECIO$CPVAL, CPToken, RECIO$ATTR )
|
|
str= "Checkpoint mode has been set to "
|
|
str := IF CPToken = 1 THEN "ON" ELSE "OFF"
|
|
PRINT str
|
|
END
|
|
|
|
* Set Archive
|
|
IF ARToken # -1 THEN
|
|
RECIO( RECIO$ARVAL, ARToken, RECIO$ATTR )
|
|
str= "Archive mode has been set to "
|
|
str := IF ARToken = 1 THEN "ON" ELSE "OFF"
|
|
* Set devices
|
|
if ARToken = 1 then
|
|
if DVToken and DEVICELIST # "" then
|
|
RECIO( DEVICELIST, DVToken, RECIO$DEVICELIST )
|
|
* indicate logging to tape
|
|
str := " with logging to tape device(s):"
|
|
print str
|
|
max=dcount(DEVICELIST,@vm)
|
|
for i = 1 to max
|
|
print "",i:") ":DEVICELIST<1,i>
|
|
next i
|
|
end else
|
|
* Set to null
|
|
RECIO( "", DVToken, RECIO$DEVICELIST )
|
|
* indicate logging to disk
|
|
str := " with logging to disk."
|
|
print str
|
|
end
|
|
end else
|
|
print str:"."
|
|
end
|
|
END
|
|
|
|
END
|