.PROC,RESTORE*I,
UPGRADE "Keyword for partial update"   = (*N=NO,*K=YES,YES,NO),
LFN "Local File Name of install tape"  = (*N=#FILE,*F),
VSN "Volume Serial Number of tape"     = (*N=,
                            *S6(ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789)),
D "tape Density (GE,PE,HD,HY)"         = (*N=PE,GE,PE,HD,HY),
UN "Installation user name"            = (*N=,*F),
.
.HELP
 The RESTORE procedure RESTOREs the NOS/VE installation files.
 Requires REPFILE procedure on NOS systems.

 Parameter   Default   Description
   Name       Value

  [upgrade]    no      Keyword indicating partial update materials used
  [lfn]                Local File Name by which the tape is accessed
  [vsn]                Volume Serial Number of the installation tape
  [d]          pe      Density of the installation tape
  [un]                 Installation user name (NOS/BE systems only)

.HELP,UPGRADE
 The UPGRADE keyword indicates that this procedure is being used as part,
 of a system upgrade and that steps should be taken to avoid damaging
 the files SITECP, DCFILE and TPXXXK.
.HELP,LFN
 The LFN parameter selects the name by which the tape is accessed.
 The default value is the file containing this procedure.
.HELP,VSN
 The VSN parameter specifies the Volume Serial Number of the installation
 tape. The local file specified for the LFN parameter is used if no VSN
 is specified.
.HELP,D
 The D parameter selects the Density of the installation tape.
 The default density is PE.
.HELP,UN
 The UN parameter specifies the permanent file ID under which the release
 files are installed. It is required only on NOS/BE systems.
.ENDHELP
UNLOAD,NVELIB,NVEPROL,NVERELS,NOSBINS,RESTORE,CYBCLIB.
UNLOAD,YYYRES,YYYLIB,YYYNOS,YYYNVP,YYYNVE,YYYSCP,YYYDCF.
UNLOAD,YYYNVR,YYYCRL,NVERELB.
.IFE,$UPGRADE$.EQ.$YES$,SITEFILES.
UNLOAD,NEWTPXK,NEWSCP,NEWDCF.
.ELSE,SITEFILES.
UNLOAD,TPXXXK,SITECP,DCFILE.
.ENDIF,SITEFILES.
.IFE,$VSN$.NE.$$,GETTAPE.
  .IFE,SYS=NOS,NOSSYS.
    LABEL,LFN,#VSN=VSN,#D=D,LB=KU,F=I,PO=R.
  .ELSE,NOSSYS.
    REQUEST,LFN,D,#VSN=VSN.
  .ENDIF,NOSSYS.
.ENDIF,GETTAPE.
.IFE,SYS=NOSB,NBESYS.
  REQUEST(YYYLIB,SN,PF)
  REQUEST(YYYNOS,SN,PF)
  REQUEST(YYYNVP,SN,PF)
  REQUEST(YYYNVE,SN,PF)
  REQUEST(YYYSCP,SN,PF)
  REQUEST(YYYDCF,SN,PF)
  REQUEST(YYYNVR,SN,PF)
  REQUEST(CYBCLIB,SN,PF)
.ENDIF,NBESYS.
REWIND,LFN.
COPYBF(LFN,YYYRES)
COPYBF(LFN,YYYLIB)
COPYBF(LFN,YYYNOS)
COPYBF(LFN,YYYNVP)
COPYBF(LFN,YYYNVE)
COPYBF(LFN,YYYSCP)
COPYBF(LFN,YYYDCF)
COPYBF(LFN,YYYNVR)
COPYBF(LFN,YYYCRL)
.IFE,SYS=NOS,NOSSYS2.
  $REWIND,YYYLIB.
  $COPY(YYYLIB,NVELIB)
  $REWIND,YYYLIB,NVELIB.
  $LIBRARY,NVELIB/A.
  REPFILE(YYYLIB,NVELIB,DEFINE=YES)
  REPFILE(YYYNOS,NOSBINS,DEFINE=YES)
  REPFILE(YYYNVP,NVEPROL)
  REPFILE(YYYNVR,NVERELS,DEFINE=YES)
  REPFILE(YYYCRL,CYBCLIB,DEFINE=YES)
  .IFE,$UPGRADE$.EQ.$YES$,PRESERVE.
    REPFILE,YYYNVE,NEWTPXK,DEFINE=YES.
    REPFILE,YYYSCP,NEWSCP.
    REPFILE,YYYDCF,NEWDCF.
  .ELSE,PRESERVE.
    REPFILE,YYYNVE,TPXXXK,DEFINE=YES.
    REPFILE,YYYSCP,SITECP.
    REPFILE,YYYDCF,DCFILE.
  .ENDIF,PRESERVE.
.ELSE,NOSSYS2.
  .IFE,$UN$.EQ.$$,NOID.
    REVERT,ABORT. NO UN SPECIFIED.
  .ENDIF,NOID.
  CATALOG,YYYLIB,NVELIBB,ID=UN,RP=999.
  CATALOG,YYYNOS,NBEBINS,ID=UN,RP=999.
  CATALOG,YYYNVP,NVEPROL,ID=UN,RP=999.
  CATALOG,YYYNVR,NVERELB,ID=UN,RP=999.
  EDITLIB,I=DIR.
  CATALOG,CYBCLIB,ID=UN,RP=999.
  .IFE,$UPGRADE$.EQ.$YES$,SAVE.
    CATALOG,YYYNVE,NEWTPXK,ID=UN,RP=999.
    CATALOG,YYYSCP,NEWSCP,ID=UN,RP=999.
    CATALOG,YYYDCF,NEWDCF,ID=UN,RP=999.
  .ELSE,SAVE.
    CATALOG,YYYNVE,TPXXXK,ID=UN,RP=999.
    CATALOG,YYYSCP,SITECP,ID=UN,RP=999.
    CATALOG,YYYDCF,DCFILE,ID=UN,RP=999.
  .ENDIF,SAVE.
  RETURN,YYYLIB,YYYNOS,YYYNVP,YYYNVR,YYYNVE,YYYSCP,YYYDCF,CYBCLIB.
  ATTACH,NVEPROL,ID=UN.
.ENDIF,NOSSYS2.
UNLOAD,DIR.
REVERT.  RESTORE COMPLETED NORMALLY.
EXIT.
REVERT,ABORT. RESTORE PROC FAILED.
.DATA,DIR
LIBRARY(CYBCLIB,NEW)
ADD(*,YYYCRL)
FINISH.
ENDRUN.
/EOR
