1 COMPILE

     The COMPILE utility  provides  a  simple  method  for  students  to
     compile,  link,  and  run their programs.  The program writes a DCL
     command procedure to compile, link and run the program.  If any  of
     the  three  steps  cause  or detect an error, the utility will stop
     execution.

     The command COMPILE has the following format:

     COMPILE [/qualifier [/...] ] file_spec

                              LOCATION OF FILES

             Source files  and  external  object  files  can  be
             located  in  any directory.  All output files, such
             as object  files  and  executable  images  will  be
             placed in the current default directory.


2 Parameters

     The only required parameter is the file that  is  to  be  compiled,
     linked,  and  executed.  The standard VAX/VMS file specification is
     used.

2 Languages

     The language qualifiers  indicate  to  the  COMPILE  utility  which
     compiler  is  to  be used.  If this qualifier is not specified, the
     utility uses the file type on the file spec that is to be compiled.
     If the file type is not specified, the utility then tries to search
     for all possible language extensions until a valid  file  with  the
     file  name and a language extension is found.  If no file is found,
     then the utility prints an error message and stops execution.

     The language qualfiers are mutually exclusive.  Only  one  language
     qualifier may be specified on a command line.

     The language qualifier also provides  a  method  to  pass  language
     dependant qualifiers into the COMPILE utility to be included on the
     compile command line in the command procedure.

/BASIC

     Format:

     /BASIC[="/language_qualifiers"]

     Indicates that the language to  be  used  is  BASIC  and  that  the
     optional  qualifiers  are  to be included in the command procedure.
     If the BASIC language qualifiers  are  specified,  the  quotes  are
     required.

/PLI

     Format:

     /PLI[="/language_qualifiers"]

     Indicates that the language to be used is PLI and that the optional
     qualifiers are to be included in the command procedure.  If the PLI
     language qualifiers are specified, the quotes are required.

/FORTRAN

     Format:

     /FORTRAN[="/language_qualifiers"]

     Indicates that the language to be used  is  FORTRAN  and  that  the
     optional  qualifiers  are  to be included in the command procedure.
     If the FORTRAN language qualifiers are specified,  the  quotes  are
     required.

/MACRO

     Format:

     /MACRO[="/language_qualifiers"]

     Indicates that the language to  be  used  is  MACRO  and  that  the
     optional  qualifiers  are  to be included in the command procedure.
     If the MACRO language qualifiers  are  specified,  the  quotes  are
     required.

/CC

     Format:

     /CC[="/language_qualifiers"]

     Indicates that the language to be used is CC and that the  optional
     qualifiers  are to be included in the command procedure.  If the CC
     language qualifiers are specified, the quotes are required.

/RPG

     Format:

     /RPG[="/language_qualifiers"]

     Indicates that the language to be used is RPG and that the optional
     qualifiers are to be included in the command procedure.  If the RPG
     language qualifiers are specified, the quotes are required.

/COBOL

     Format:

     /COBOL[="/language_qualifiers"]

     Indicates that the language to  be  used  is  COBOL  and  that  the
     optional  qualifiers  are  to be included in the command procedure.
     If the COBOL language qualifiers  are  specified,  the  quotes  are
     required.

/PASCAL

     Format:

     /PASCAL[="/language_qualifiers"]

     Indicates that the language to be  used  is  PASCAL  and  that  the
     optional  qualifiers  are  to be included in the command procedure.
     If the PASCAL language qualifiers are  specified,  the  quotes  are
     required.

2 Qualifiers

/AUDIT

     Format:

     /[NO]AUDIT      Default -- /NOAUDIT

     The /AUDIT qualifier causes  the  COMPILE  utility  to  generate  a
     command  procedure  that  audits  the  execution of the program and
     includes a listing of the program in the audit.

     The /AUDIT qualifier cannot be used with  the  /INSTALL  or  /DEBUG
     qualifier, and must be used with the /LIST qualifier.

/DEBUG

     Format:

     /[NO]DEBUG      Default -- /NODEBUG

     The /DEBUG qualifier causes the source program to be compiled,  the
     object module to be linked, and the executable image to be run with
     the  debugger.   Since  the   debugger   is   most   efficient   on
     non-optimized  programs, the /NOOPTIMIZE qualifier is included when
     /DEBUG is specified.  To override the  /NOOPTIMIZE  qualifier  when
     using /DEBUG, use the /OPTIMIZE qualifier in the COMPILE command.

/EXTERNAL

     Format:

     /[NO]EXTERNAL=["]file_spec["]      Default -- /NOEXTERNAL

     The /EXTERNAL qualifier allows an external file to be linked to the
     file being linked from the COMPILE command.

/LIBRARY

     Format:

     /[NO]LIBRARY      Default -- /NOLIBRARY

     The /LIBRARY qualifier allows a  library  to  be  linked  with  the
     object module.

/LIST

     Format:

     /[NO]LIST[=file_spec]     Default -- /NOLIST

     The /LIST qualifier causes a list file to  be  created  during  the
     compile.   The list file will have the source file name with a .LIS
     extension unless specified with the qualifier.  If  this  qualifier
     is not specified, no list file is created.

/LINK

     Format:

     /LINK="link_command_qualifiers"      Default -- /LINK=""

     The /LINK="" qualifier adds the string enclosed in  the  quotes  to
     the link command.  The quotation marks are required.

/OBJECT

     Format:

     /[NO]OBJECT=file_spec      Default -- /OBJECT

     The /OBJECT qualifier causes the compiler output to be placed  into
     the  specified  file.   If  this  qualifier  is  not specified, the
     default is a file with the same name as the  source  file  with  an
     extension of .OBJ.

/OPTIMIZE

     Format:

     /[NO]OPTIMIZE      Default -- /OPTIMIZE for most languages

     The /OPTIMIZE qualifier causes the compiler to optimize the program
     during   compiliation.    Specifying   NOOPTIMIZE   turns  off  the
     optimization.

/INSTALL

     Format:

     /[NO]INSTALL[=file_spec]      Default -- /NOINSTALL

     This qualifier causes the COMPILE  utility  to  place  the  created
     command  file  on  the users current directory and defines a symbol
     that  is  used  to  invoke  the  command  procedure.   If  no  file
     specification  is  indicated in the /INSTALL qualifier, the name of
     the file to be compiled is used.  To delete the  command  file  and
     the  symbol definition, enter the invoking command with a parameter
     DELETE.

     COMPILE/INSTALL THIS.PLI creates a command file called THIS.COM and
     defines  a  symbol  THIS.   To delete the command procedure and the
     symbol definition, enter the command THIS DELETE.

/STEP

     Format:

     /STEP={[NO]LINK,[NO]RUN}      Default -- /STEP=RUN

     This qualifier takes on one of two values (the two values can  also
     be  negated).   Specifying  LINK  will cause the compile utility to
     generate a command procedure that will only compile  and  link  the
     program,  without attempting to run the program.  Specifying NOLINK
     will only cause the program to be compiled.   Specifying  NORUN  is
     the  same  as  specifying  LINK.  Specifying RUN is the same as not
     specifying /STEP at all.

/INVOKE

     Format:

     /[NO]INVOKE      Default -- /INVOKE when /INSTALL not specified,
                                 /NOINVOKE when /INSTALL specified

     The qualifier /INVOKE  will  cause  the  command  procedure  to  be
     invoked after it is created.  Specifying /NOINVOKE will prevent the
     command procedure not to be invoked.  This can be used  to  overide
     the  default  action.   If  the /INSTALL is missing or negated, the
     default action  is  to  invoke  the  procedure.   If  the  /INSTALL
     qualifier is specified, the action is not to invoke the procedure.

2 Examples

     COMPILE/BASIC PROG1            -- compiles the file PROG1.BAS
     COMPILE PROG1.BAS              -- compiles the file PROG1.BAS
     COMPILE PROG1                  -- compiles the file PROG1.  A
                                       search is made for the proper
                                       extension.
     COMPILE PROG2.PLI/LIST         -- compiles the file PROG2.PLI and
                                       provides a list file.
     COMPILE/LIST/STEP=NORUN PROG2  -- compiles the file PROG2 after
                                       searching for the proper
                                       extension, provides a list file
                                       but does run the program.
     COMPILE/INSTALL=COMP PROG3.COB -- generates a command procedure
                                       to compile the COBOL program
                                       PROG3 and writes the command
                                       procedure to the default dir-
                                       ectory, defines a symbol COMP to
                                       invoke the procedure COMP.COM.
