home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hall of Fame
/
HallofFameCDROM.cdr
/
3x400
/
backup.lzh
/
BKP102.RPG
< prev
next >
Wrap
Text File
|
1988-10-04
|
15KB
|
188 lines
~ H* * CRTRPGPGM PGM(BKP102.YOURLIB) SRCFILE(YOUSRC.YOURLIB) +
~ H* USRPRF(*USER) PUBAUT(*NORMAL) *
~ H*
~ H* ***********************************************************
~ H* * PROGRAM: BKP102.YOURLIB *
~ H* * DISCRIPTION: EXECUTE BACKUP COMMANDS *
~ H* * *
~ H* * *
~ H* * COMPILATION OPTIONS: NONE *
~ H* * SWITCHES: NONE *
~ H* * *
~ H* * WRITEN BY BRIAN GREWAL. *
~ H* * *
~ H* * DITO DITTO DITTTO *
~ H* * *
~ H* * *
~ H* * *
~ H* * *
~ H* ***********************************************************
H*
FBACKUPF IF E K DISK
E PM 1 2 52 PARM MESSAGE
E OBJ 50 11
E LIB 50 11
C *ENTRY PLIST ~
C PARM WBKPTP 7 ~BACKUP TYPE
C PARM DEVICE 1 ~SAVE DEVICE
~ C* DEFINE KEY
~ C*
C KEY KLIST ~
C KFLD WORK ~
C KFLD WSAVCD ~
C KFLD WORKLI 10 ~
C KFLD WORKOB 10 ~
~ C**
~ C* BACKUP TYPE VALID CODES ARE :-
~ C* DAILY - FOR DAILY BACKUP
~ C* WEEKLY - FOR WEEKLY BACKUP
~ C* MONTHLY - FOR MONTHLY BACKUP
~ C* SPECIAL - FOR SPECIAL BACKUPS
~ C**
C WBKPTP IFNE 'DAILY ' ~
C WBKPTP ANDNE'WEEKLY ' ~
C WBKPTP ANDNE'MONTHLY' ~
C WBKPTP ANDNE'SPECIAL' ~
C MOVELWBKPTP PM,1 ~
C PM,1 DSPLY ~
C GOTO EXIT ~
C END ~
~ C**
~ C* DEVICE TYPE VALID CODES ARE :-
~ C* D - DISKETTE DRIVE
~ C* T - TAPE DRIVE
~ C* S - SAVE FILES
~ C**
C DEVICE IFNE 'D' ~
C DEVICE ANDNE'T' ~
C DEVICE ANDNE'S' ~
C MOVELDEVICE PM,2 ~
C PM,2 DSPLY ~
C GOTO EXIT ~
C END ~
~ C**
~ C* PARMS PASSED WERE VALID SO START PROCESSING
~ C**
~ C** SET ON/ OFF INDICATORS
C MOVE '1' ON 1 ~
C MOVE '0' OFF 1 ~
~ C*
C MOVEL'*ALL' DEFALT 10 ~
~ C* PROCESS SAVELIB COMMANDS
C MOVELWBKPTP WORK 1 ~
C MOVE 'A' WSAVCD 1 ~
C KEY SETLLBACKUPF ~
C Z-ADD0 X 20 ~
C MOVE *BLANKS LIB ~
C MOVE *BLANKS OBJ ~
~ C**
~ C* RETURN HERE FOR NEXT SET OF "A" SAVE CODES
~ C**
C NEXTSA TAG ~
C X DOWLE49 ~
C READ BACKUPF 50~
C *IN50 IFEQ OFF ~
C WORK ANDEQBKPTYP ~
C SAVCOD ANDEQ'A' ~
C ADD 1 X ~
C MOVELLIBNAM LIB,X ~
C ELSE ~
C GOTO SKIPA ~
C END ~*IN50 IFEQ OFF
C N50 END ~X DOWLE 49
C SKIPA TAG ~
~ C**
~ C* DEFAULT OBJ,1 WITH "*ALL"
~ C**
C X IFGE 1 ~
C MOVELDEFALT OBJ,1 ~
C MOVE *BLANKS RTNCOD 8 ~
C CALL 'BACKUP' ~
C PARM WBKPTP ~
C PARM DEVICE ~
C PARM OBJ ~
C PARM LIB ~
C PARM WSAVCD ~
C PARM RTNCOD ~
C RTNCOD CABEQ'ABORT 'EXIT ~
C END ~X IFGE 1
~ C**
~ C* IF 50 OBJECTS READ AND MORE LEFT GOTO READ AGAIN
~ C**
C BKPTYP IFEQ WORK ~
C *IN50 ANDEQOFF ~
C SAVCOD ANDEQ'A' ~
C MOVE *BLANKS LIB ~
C MOVE *BLANKS OBJ ~
C Z-ADD1 X ~
C MOVELLIBNAM LIB,X ~
C GOTO NEXTSA ~
C END ~BKPTYP EQ WBKP
~ C**
~ C* IF BKPTYP CHANGED OR EOF REACHED EXIT
~ C**
C WORK CABNEBKPTYP EXIT ~
C *IN50 CABEQON EXIT ~
~ C**
~ C* IF FINISHED "A" SAVE CODES PROCESS "S" SAVE CODES
~ C**
C MOVE 'S' WSAVCD ~
C KEY SETLLBACKUPF ~
C Z-ADD0 X 20 ~
C MOVE *BLANKS OBJ ~
C MOVE *BLANKS LIB ~
~ C**
~ C* RETURN HERE FOR NEXT SET OF "S" SAVE CODES
~ C**
C NEXTSS TAG ~
C X DOWLE49 ~
C READ BACKUPF 50~
C *IN10 IFEQ OFF ~
C MOVE LIBNAM WLIBNM 10 ~
C SETON 10 ~
C END ~*IN10 EQ OFF
C *IN50 IFEQ OFF ~
C WORK ANDEQBKPTYP ~
C SAVCOD ANDEQ'S' ~
C LIBNAM ANDEQWLIBNM ~
C ADD 1 X ~
C MOVELOBJNAM OBJ,X ~
C ELSE ~
C GOTO SKIPS ~
C END ~*IN50 IFEQ OFF
C N50 END ~X DOWLE 49
C SKIPS TAG ~
C X IFGE 1 ~
C MOVELWLIBNM LIB,1 ~
C MOVE *BLANKS RTNCOD 8 ~
C CALL 'BACKUP' ~
C PARM WBKPTP ~
C PARM DEVICE ~
C PARM OBJ ~
C PARM LIB ~
C PARM WSAVCD ~
C PARM RTNCOD ~
C RTNCOD CABEQ'ABORT 'EXIT ~
C MOVE LIBNAM WLIBNM ~
C END ~X IFGE 1
~ C**
~ C* IF 50 OBJECTS READ AND MORE LEFT GOTO READ AGAIN
~ C**
C BKPTYP IFEQ WORK ~
C *IN50 ANDEQOFF ~
C SAVCOD ANDEQ'S' ~
C MOVE *BLANKS OBJ ~
C MOVE *BLANKS LIB ~
C Z-ADD1 X ~
C MOVELOBJNAM OBJ,X ~
C GOTO NEXTSS ~
C END ~BKPTYP EQ WBKP
~ C**
~ C* EXIT POINT
~ C**
C EXIT TAG ~
C SETON LR ~
** INVALID PARMS PASSED
is Invalid backup type. BACKUP CANCELED
is Invalid device type. BACKUP Command CANCELED