home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hall of Fame
/
HallofFameCDROM.cdr
/
3x400
/
backup.lzh
/
BKPSAVF.CLP
< prev
next >
Wrap
Text File
|
1988-10-04
|
6KB
|
80 lines
/*~ CRTCLPGM PGM(BKPSAVF.YOURLIB) SRCFILE(YOUSRC.YOURLIB) +
~ USRPRF(*OWNER) PUBAUT(*NORMAL) ~*/
/*~*******************************************************~*/
/*~PROGRAM: BKPSAVF.YOURLIB ~*/
/*~DISCRIPTION: BACKUP SAVE FILES TO DISK OR TAPE ~*/
/*~ ~*/
/*~COMPILATION OPTIONS: CREATE DSPFD OUTFILE IN QTEMP ~*/
/*~ EXECUTE FOLLOWING COMMAND FROM COMMAND ENTRY SCREEN ~*/
/*~ DSPFD FILE(SA*.QGPL) TYPE(*BASATR) OUTPUT(*NONE) + ~*/
/*~ FILEATR(*SAV) OUTFILE(DSPFD.QTEMP) ~*/
/*~SWITCHES: NONE ~*/
/*~ ~*/
/*~WRITEN BY BRIAN GREWAL. ~*/
/*~ ~*/
/*~I TAKE NO RESPONSIBILITY OF FUNCTION OF THIS CODE. ~*/
/*~COMPILE AND EXECUTE IT AT YOUR OWN RISK. ~*/
/*~ ~*/
/*~ ~*/
/*~ ~*/
/*~*******************************************************~*/
PGM PARM(&DEVICE)
DCL &DEVICE *CHAR 1
DCL &TYPE *CHAR 1
DCL &FULLDEV *CHAR 10
DCL &CMD *CHAR 1200
DCL VAR(&ATTR) TYPE(*CHAR) LEN(1) VALUE(X'2B')
DCL VAR(&NORMAL) TYPE(*CHAR) VALUE(X'20')
DCLF DSPFD.QTEMP
RTVJOBA TYPE(&TYPE)
CHGJOB INQMSGRPY(*SYSRPYL) OUTQ(QSAVEOUTQ)
DSPOBJD OBJ(SA*.QGPL) OBJTYPE(*FILE) OUTPUT(*LIST)
MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(END))
DSPFD FILE(SA*.QGPL) TYPE(*BASATR) OUTPUT(*NONE) +
FILEATR(*SAV) OUTFILE(DSPFD.QTEMP)
CLRDKT LOC(*M1 1 *ONLY)
IF COND(&DEVICE = 'D') THEN(CHGVAR VAR(&FULLDEV) +
VALUE('Diskette'))
ELSE CMD(CHGVAR VAR(&FULLDEV) VALUE('Tape'))
READ: RCVF
MONMSG CPF0864 EXEC(GOTO EOF)
DSPSAVF FILE(&ATFILE.QGPL) OUTPUT(*LIST)
IF COND(&TYPE = '1') THEN(SNDPGMMSG +
MSGID(CPF9898) MSGF(QCPFMSG.QSYS) +
MSGDTA('Saving data from' *TCAT &ATTR *TCAT +
&ATFILE *TCAT &NORMAL *TCAT 'savefile to' +
*BCAT &FULLDEV) TOPGMQ(*EXT) +
MSGTYPE(*STATUS))
/*~ SAVE TO DISKETTE ~*/
IF (&DEVICE *EQ 'D') DO
CHGVAR VAR(&CMD) VALUE('SAVSAVFDTA SAVF(' *TCAT +
&ATFILE *TCAT '.QGPL) LOC(*M12 *SEARCH) +
CLEAR(*YES)')
CALL QCAEXEC (&CMD 1200)
MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(READ))
DLTF &ATFILE.QGPL
GOTO READ
ENDDO /*~ DEVICE IFEQ 'D' ~*/
/*~ SAVE TO TAPE ~*/
IF (&DEVICE *EQ 'T') DO
CHGVAR VAR(&CMD) VALUE('SAVSAVFDTA SAVF(' *TCAT +
&ATFILE *TCAT '.QGPL) DEV(QTAPE) +
ENDOPT(*LEAVE) CLEAR(*YES)')
CALL QCAEXEC (&CMD 1200)
MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(READ))
DLTF &ATFILE.QGPL
GOTO READ
ENDDO /*~ DEVICE IFEQ 'T' ~*/
GOTO READ
EOF: DSPOBJD OBJ(SA*.QGPL) OBJTYPE(*FILE) OUTPUT(*LIST)
MONMSG CPF0000
SNDPGMMSG MSGID(CPI9801) MSGF(QCPFMSG.QSYS) +
TOPGMQ(*EXT) MSGTYPE(*STATUS)
END: ENDPGM