tldm-universe/Ardent/UV/APP.PROGS/REL.LFILE.B

118 lines
2.6 KiB
Plaintext
Raw Permalink Normal View History

2024-09-09 21:51:08 +00:00
******************************************************************************
*
* System Admin Transaction Logging - Release Log File
*
* 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.
* 10/14/94 15104 DTM Fixed to verify number of prompts
* 05/15/94 13286 DTM Initial programming
*
*******************************************************************************
id = "%W%"
*******************************************************************************
* Inserts
$INCLUDE UNIVERSE.INCLUDE TLOG.H
* Check that this user is a system administrator
ALLOWED = 0
CALL *ISUSER.B(0, ALLOWED)
IF NOT(ALLOWED) THEN
ERROR = NOT.ADMINISTRATOR.ERROR
GOSUB ERROR.SUB
GOTO EXIT
END
* Do some initialization
GOSUB INIT
* release log file
GOSUB RELEASE.LOGFILE
* Finished
GOTO EXIT
*====
INIT:
*====
* Parse command line
TMP = TRIM( @SENTENCE )
CNT = COUNT( TMP, " " )
IF ( CNT NE 1 ) THEN
ERROR = INCORRECT.NUM.ARGS
GOSUB ERROR.SUB
GOTO EXIT
STOP
END
SEQUENCE.NUMBER = FIELD( TMP, " ", 2 )
Sel.Stmt = "SELECT UV_LOGS WITH STATUS = 'Full' BY @ID SAVING @ID"
EXECUTE Sel.Stmt RTNLIST tmpl CAPTURING junk
READNEXT FIRST.NUMBER FROM tmpl THEN
IF FIRST.NUMBER # SEQUENCE.NUMBER THEN
ERROR = NOT.LOWEST.SEQ.NUM.ERROR
GOSUB ERROR.SUB
GOTO EXIT
END
END
RETURN
*=============
RELEASE.LOGFILE:
*=============
RECIO( SEQUENCE.NUMBER, RECIO$CLEAR )
RETURN
*=========
ERROR.SUB:
*=========
* Error handling routine
PRINT @SYS.BELL
* Set return code and report the error
BEGIN CASE
CASE ERROR = NOT.ADMINISTRATOR.ERROR
PRINT 'Error: Only the UniVerse Administrator can DELETE log files.'
CASE ERROR = NOT.LOWEST.SEQ.NUM.ERROR
PRINT 'Error: Log Sequence Number must be the lowest available'
CASE ERROR = INCORRECT.NUM.ARGS
PRINT 'Error: Incorrect number of arguments'
END CASE
RETURN
*---------------
EXIT:
*---------------
STOP
END
* END-CODE