.PROC,COMPCCL*I,
I "- source input file name"             = (*F),
L "- listing output file name"           = (*F),
B "- binary output library name"         = (*F),
LO "- listing options"                   = (S,NONE,*N=S),
UN "- NOS/BE perm file ID"               = (*F,*N=),
.
.HELP
 The COMPCCL procedure COMPiles a CCL procedure into a user library.
 This procedure is used as the Cyber 170 half of a NOS/VE CCL
 procedure builder.

 Parameter   Default   Description
   Name       Value

   I          none     Source input file name
   L          none     Listing output file name
   B          none     Binary output library name
   LO          S       Listing options (S=source,NONE)
   UN                  User name in which file resides

.HELP,I
 The I parameter specifies the input source file. This file may be
 local or permanent.
.HELP,L
 The L parameter specifies the output listing file name. This file
 will be permanent.
.HELP,B
 The B parameter specifies the binary output library. The binary
 modules will be added to or replaced in this library as required.
.HELP,LO
 The LO parameter specifies the listing options. If not supplied
 a listing will be produced.
.HELP,UN
 The UN parameter specifies a permanent file ID on NOS/BE systems. This
 parameter must not be specified on NOS.
.ENDHELP
.IF,SYS.EQ.NOSB,CHECKUN.
  REQUEST,YYYYYDF,PF.
  REQUEST,L,PF.
  .IF,$UN$.EQ.$$,BADUN.
    NOTE(OUTPUT); THE #UN PARAMETER MUST BE SPECIFIED.
    REVERT,ABORT.
  .ENDIF,BADUN.
.ELSE,CHECKUN.
  .IF,$UN$.NE.$$,BADUN2.
    REVERT,ABORT. THE #UN PARAMETER MUST NOT BE SPECIFIED
  .ENDIF,BADUN2.
.ENDIF,CHECKUN.
GETFILE(I,I,UN,READ,YES)
SKIP(SOURCEOK)
  EXIT.
  .IF,SYS.EQ.NOS.NOEXIT.
  DAYFILE(#L=YYYYYDF,FR=COMPCCL,OP=M)
  REPFILE(YYYYYDF,YYYYYDF,PRIVATE,READ,,UN)
  .IF,SYS.EQ.NOS.ONEXIT.
  UNLOAD(YYYYYDF)
  NOTE(OUTPUT,NR); NO SOURCE FILE FOUND
  REVERT(ABORT) NO SOURCE FILE FOUND
ENDIF(SOURCEOK)
REPLIB(I,B,PROC,UN)
SKIP(REPOK)
  EXIT.
  .IF,SYS.EQ.NOS.NOEXIT.
  DAYFILE(#L=YYYYYDF,FR=COMPCCL,OP=M)
  REPFILE(YYYYYDF,YYYYYDF,PRIVATE,READ,,UN)
  .IF,SYS.EQ.NOS.ONEXIT.
  UNLOAD(YYYYYDF,I)
  NOTE(OUTPUT,NR); LIBRARY REPLACE FAILED
  REVERT(ABORT) LIBRARY REPLACE FAILED
ENDIF(REPOK)
.IFE($LO$.EQ.$S$,LIST)
  GETFILE(I,I,UN,READ,YES)
  .IFE,SYS.EQ.NOS.UNLOAD(L)
  COPYSBF(I,L)
.ELSE(LIST)
  NOTE(L)/ LISTING SUPPRESSION REQUESTED
.ENDIF(LIST)
REPFILE(L,L,PRIVATE,READ,,UN)
SKIP(REPFILEOK)
  EXIT.
  .IF,SYS.EQ.NOS.NOEXIT.
  DAYFILE(#L=YYYYYDF,FR=COMPCCL,OP=M)
  REPFILE(YYYYYDF,YYYYYDF,PRIVATE,READ,,UN)
  .IF,SYS.EQ.NOS.ONEXIT.
  UNLOAD(YYYYYDF,L,I)
  NOTE(OUTPUT,NR); LISTING PHASE FAILED
  REVERT(ABORT) LISTING PHASE FAILED
ENDIF(REPFILEOK)
UNLOAD(I,L)
.IF,SYS.EQ.NOS.NOEXIT.
DAYFILE(#L=YYYYYDF,FR=COMPCCL,OP=M)
REPFILE(YYYYYDF,YYYYYDF,PRIVATE,READ,,UN)
.IF,SYS.EQ.NOS.ONEXIT.
UNLOAD(YYYYYDF)
REVERT. COMPILE I --> B SUCCESSFUL
/EOR
