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

410 lines
12 KiB
Plaintext
Raw 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 - Rollforward a 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.
* 03/25/96 18212 LAG Windows NT port
* 06/27/95 16790 GMH Allow multi log restore from tape
* 06/21/95 16719 DTM Fixed display to screen option
* 06/08/95 16198 GMH Fix
* 06/07/95 16198 GMH Add tape rollforward support
* 03/09/95 15857 DTM Changed default log #
* 10/12/94 15101 DTM Changed length of log number field
* 09/29/94 15032 DTM Increased size of field for data entry
* 05/15/94 13286 DTM Initial Programming
*
*******************************************************************************
id = "%W%"
*******************************************************************************
******************
** Windows NT port
**
DEFFUN IS.FULLPATH(FILESPEC) CALLING "*IS.FULLPATH"
**
******************
*******************************************************************************
* Call initialization routines
*******************************************************************************
TPRINT @(-1)
temp = NULL
CALL *ISUSER.B(0, temp)
IF temp = 0 THEN
TPRINT UVREADMSG(071000,"")
SLEEP 3
STOP
END
* Check for TAPE keyword
locate("TAPE",convert(" ",@fm,@sentence);FROM.TAPE) else FROM.TAPE = 0
* open device file
open '&DEVICE&' to DEVICE.FILE else
print UVREADMSG(1520,"&DEVICE")
sleep 2
end
GOSUB init.form
CALL *DRAW.SCRN.B( RFF.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<form.line,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 = UP.ARROW
TPRINT form<form.line,2>:PRMPT:
IF temp.form<form.line> # NULL THEN
TPRINT temp.form<form.line>:
TPRINT STR(SPACE,27-len(temp.form<form.line>)):
END
ELSE
TPRINT group.defaults<form.line>:
TPRINT STR(SPACE,27-len(group.defaults<form.line>)):
END
form.line -=1
IF form.line < 1 THEN
form.line = form.size
END
GOTO help.loop
CASE special = DOWN.ARROW
TPRINT form<form.line,2>:PRMPT:
IF temp.form<form.line> # NULL THEN
TPRINT temp.form<form.line>:
TPRINT STR(SPACE,27-LEN(temp.form<form.line>)):
END
ELSE
TPRINT group.defaults<form.line>:
TPRINT STR(SPACE,27-LEN(group.defaults<form.line>)):
END
form.line +=1
IF form.line > form.size THEN
form.line = 1
END
GOTO help.loop
CASE special = F.1
CALL *HELP.PRINT.B(form< form.line,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=UVREADMSG(073634,"")
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
BEGIN CASE
CASE form.line = 1
IF temp = NULL THEN
CALL *HELP.PRINT.B( NULL, 3 )
CALL *HELP.BOX.B( 17, 5, 30, RFF.MSG9 )
temp.form< form.line > = NULL
TPRINT form<form.line,2>:PRMPT:temp.form<form.line>:
TPRINT STR(SPACE,42-LEN(temp.form<form.line>)):
GOTO help.loop
END
******************
** Windows NT port
**
IF NOT(IS.FULLPATH(temp)) THEN
CALL *HELP.PRINT.B( NULL, 3 )
CALL *HELP.BOX.B( 17, 5, 30, "Must be full Pathname" )
temp.form< form.line > = NULL
TPRINT form<form.line,2>:PRMPT:temp.form<form.line>:
TPRINT STR(SPACE,42-LEN(temp.form<form.line>)):
GOTO help.loop
END
**
******************
FileName = temp
temp.form< form.line > = temp
CASE form.line = 2
if not(FROM.TAPE) then
LogDir = temp
temp.form< form.line > = temp
end else
ArchiveList = convert(" ",@VM,temp)
RESTART:
IF ArchiveList = "" THEN
CALL *HELP.BOX.B( 10, 10, 40, "At least ONE tape device must be defined." )
* Repaint previous line
TPRINT form<form.line-1,2>:PRMPT:temp.form<form.line-1>:
TPRINT STR(SPACE,16-LEN(temp.form<form.line-1>)):
* Repaint current line
temp.form< form.line > = ""
TPRINT form<form.line,2>:PRMPT:temp.form<form.line>:
TPRINT STR(SPACE,16-LEN(temp.form<form.line>)):
GOTO help.loop
END
* Verify Devices List
VAL=0
LOOP
REMOVE CURDEV FROM ArchiveList SETTING MARK
VAL += 1
* Check in device file
READ DEVREC FROM DEVICE.FILE,CURDEV ELSE
CALL *HELP.BOX.B( 10, 10, 40, CURDEV:" is not in &DEVICE& file. Removed from list." )
del ArchiveList<1,VAL>
goto RESTART
END
* Check if tape
IF DEVREC<4> # "DC" AND DEVREC<4> # "DT" THEN
CALL *HELP.BOX.B( 10, 10, 40, CURDEV:" is not a tape device. Removed from list." )
del ArchiveList<1,VAL>
goto RESTART
END
UNTIL MARK = 0 DO REPEAT
temp.form<form.line> = convert(@VM," ",ArchiveList)
end
CASE form.line = 3
BegLog = temp
temp.form< form.line > = temp
CASE form.line = 4
EndLog = temp
temp.form< form.line > = EndLog
CASE form.line = 5
Flag = UPCASE( temp )
IF Flag = "YES" OR Flag = "NO" THEN
IF BegLog = "0" AND Flag = "YES" THEN
CALL *HELP.PRINT.B( NULL, 3 )
CALL *HELP.BOX.B( 17, 5, 45, RFF.MSG10 )
form.line = 3
temp.form< form.line > = NULL
TPRINT form<form.line,2>:PRMPT:temp.form<form.line>:
TPRINT STR(SPACE,16-LEN(temp.form<form.line>)):
GOTO help.loop
END
* Force to non-checking
if (FROM.TAPE) then
temp = "NO"
Flag = "NO"
end
temp.form< form.line > = temp
END
ELSE
CALL *HELP.PRINT.B( NULL, 3 )
CALL *HELP.BOX.B( 17, 5, 30, RFF.MSG11 )
temp.form< form.line > = NULL
TPRINT form<form.line,2>:PRMPT:temp.form<form.line>:
TPRINT STR(SPACE,16-LEN(temp.form<form.line>)):
GOTO help.loop
END
CASE form.line = 6
IF temp # "0" AND temp # "1" and temp # "2" and temp # "3" THEN
CALL *HELP.PRINT.B( NULL, 3 )
CALL *HELP.BOX.B( 17, 5, 45, RFF.MSG12 )
temp.form< form.line > = "0"
TPRINT form<form.line,2>:PRMPT:temp.form<form.line>:
TPRINT STR(SPACE,16-LEN(temp.form<form.line>)):
GOTO help.loop
END
Verbosity = temp
temp.form< form.line > = temp
END CASE
TPRINT form<form.line,2>:PRMPT:temp.form<form.line>:
TPRINT STR(SPACE,16-LEN(temp.form<form.line>)):
form.line+=1
IF form.line <= form.size THEN
GOTO help.loop
END
ELSE
GOSUB roll.forward
END
END
STOP @(-1)
*************************************************************************
* roll.forward
*************************************************************************
roll.forward:
retry = 1
msg = "Do you wish output to go to the Screen?"
CALL *YES.NO.BOX.B(6, msg, retry )
Exec.Sentence = OS.EXEC:" '":UV.BIN:"/uvrolf "
if not(FROM.TAPE) then Exec.Sentence := "-l":LogDir
Exec.Sentence := " -f ":FileName
IF retry THEN
Exec.Sentence := " -s "
END
IF Flag = "YES" THEN
Exec.Sentence := " -c ":BegLog:" ":EndLog
END ELSE
Exec.Sentence := " -u ":BegLog:" ":EndLog
END
if FROM.TAPE then
Exec.Sentence := " -t ":change(ArchiveList,@vm," -t ",-1)
end
Exec.Sentence := " -v":Verbosity:"'"
TPRINT @(-1)
EXECUTE Exec.Sentence
SLEEP 4
RETURN
*************************************************************************
* 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
temp.form<1> = ""
temp.form<2> = ""
if not(FROM.TAPE) then
Path = ""
RECIO( Path, RECIO$PATH )
temp.form<2> = Path
end else
Dev=""
RECIO( Dev, 0, RECIO$DEVICELIST )
temp.form<2> = convert(@vm," ",Dev)
end
temp.form<3> = "1"
temp.form<4> = "1"
temp.form<5> = "NO"
temp.form<6> = "0"
form.size = 6
form.line = 1
form<1,1> = @(5,4)
form<1,2> = @(35,4)
form<1,3> = RFF.MSG1
form<1,4> = RFF.MSG2
form<1,5> = form<1,4>
form<1,6> = 42
form<2,1> = @(5,6)
form<2,2> = @(35,6)
if not(FROM.TAPE) then
form<2,3> = "Logging Directory"
form<2,4> = "Enter the location of the logging files to restore from"
end else
form<2,3> = "Device list to restore from"
form<2,4> = "Space delimited list of &DEVICE& entries."
end
form<2,5> = form<2,4>
form<2,6> = 35
form<3,1> = @(5,8)
form<3,2> = @(35,8)
form<3,3> = RFF.MSG3
form<3,4> = RFF.MSG4
form<3,5> = form<3,4>
form<3,6> = 9
form<4,1> = @(5,10)
form<4,2> = @(35,10)
form<4,3> = RFF.MSG5
form<4,4> = RFF.MSG6
form<4,5> = form<4,4>
form<4,6> = 9
form<5,1> = @(5,12)
form<5,2> = @(35,12)
form<5,3> = RFF.MSG7
form<5,4> = RFF.MSG8
form<5,5> = form<5,4>
form<5,6> = 36
form<6,1> = @(5,14)
form<6,2> = @(35,14)
form<6,3> = RFF.MSG13
form<6,4> = RFF.MSG14
form<6,5> = RFF.MSG15
form<6,6> = 36
group.defaults = NULL
group.defaults<1> = NULL
group.defaults<2> = NULL
group.defaults<3> = NULL
group.defaults<4> = NULL
group.defaults<5> = NULL
group.defaults<6> = NULL
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