Restoring File to a New Name
Q. Am I missing something, or is there no easy way to restore an individual file from tape with a new name? I don't want to have to delete or rename the current version of the file on disk just to use data from the tape backup. Something like RSTFRMTAP FROMFILE(filename) TOFILE(newname) would be nice. Is there a way to do this?
A. You cannot rename a file when you restore. However, you can restore that file to another library and then rename it. If you wanted to automate the step, you could restore the file to QTEMP, rename the object and then move it to the library you want. See 6. Obviously, you would have to work on this shell. I just threw this together. Hope it helps.
A. You cannot rename a file when you restore. However, you can restore that file to another library and then rename it. If you wanted to automate the step, you could restore the file to QTEMP, rename the object and then move it to the library you want. See Figure 6. Obviously, you would have to work on this shell. I just threw this together. Hope it helps.
TechTalk: Restoring File to a New Name
Figure 6 Program for restoring file to a different name
Figure 6: Program for Restoring File to a Different Name PGM PARM(&FILENAME &LIBRARY &NEWFILE) DCL VAR(&FILENAME) TYPE(*CHAR) LEN(10) DCL VAR(&LIBRARY) TYPE(*CHAR) LEN(10) DCL VAR(&NEWFILE) TYPE(*CHAR) LEN(10) RSTOBJ OBJ(&FILENAME) LIB(&LIBRARY) DEV(QTAPE) + RSTLIB(QTEMP) ... (whatever else you need) RNMOBJ OBJ(QTEMP/&FILENAME) OBJTYPE(*FILE) + NEWOBJ(&NEWFILE) MOVEOBJ OBJ(QTEMP/&NEWFILE) OBJTYPE(*FILE) + TOLIB(&LIBRARY) ENDPGM
LATEST COMMENTS
MC Press Online