.PROC,PRIFILE*I,
LFN "- Local File Name"                = (*F),
PFN "- Permanent File Name"            = (*N=,*F),
UN "- User Name of permanent file"     = (*N=,*F),
DC "- Disposition Code"                = (*N=LP,LP,LR,LS,LT),
EC "- External Characteristics"        = (*N=A9,A9,A6),
FC "- Forms Code"                      = (*N=,
                                    *S2(ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789)),
.
.HELP
 The PRIFILE procedure routes a PRInt FILE. Requires the GENLSTF binaries.

 Parameter   Default   Description
   Name       Value

   lfn                 local file name by which the file is accessed
  [pfn]       lfn      permanent file name of the stored file
  [un]                 user name in which file resides
  [dc]        lp       disposition code for the output file
  [ec]        a9       external characteristics of the output file
  [fc]                 output file forms code

.HELP,LFN
 The LFN parameter selects the name by which the file is accessed.
.HELP,PFN
 The PFN parameter selects the name by which the file is stored.
 The default is the value specified for the LFN parameter.
.HELP,UN
 The UN parameter specifies the User Name location of the file.
 The default value is the User Name in which this procedure executes.
.HELP,DC
 The DC parameter specifies the disposition code for the output file.
 Options are: lp - queued to print on any printer (default value)
              lr - queued to print on 580-12 printer
              ls - queued to print on 580-16 printer
              lt - queued to print on 580-20 printer
.HELP,EC
 The EC parameter specifies the external characteristics of the file.
 Options are:  a9  - ASCII graphic 95-character set (default value)
               a6  - ASCII graphic 63/64-character set
.HELP,FC
 The FC parameter specifies a 2-character forms code for the file.
 Options are: 1-2 alphanumeric characters, or omitted (default value).
.ENDHELP
.IFE,FILE(LFN,.NOT.AS),FILEPRM.
  GETFILE,LFN,PFN,UN,READ,A=YES.
.ELSE,FILEPRM.
  $REWIND,LFN.
.ENDIF,FILEPRM.
.IFE,$EC$.EQ.$A9$,ASCII95.
  GENLSTF(LFN,YYYYTMP,,CS612,CS812)
.ELSE,ASCII95.
  GENLSTF(LFN,YYYYTMP,,CS612,CS612)
.ENDIF,ASCII95.
.IFE,$FC$.EQ.$$,NOFORMS.
  $ROUTE(YYYYTMP,#DC=DC,TID=C,#EC=EC)
.ELSE,NOFORMS.
  $ROUTE(YYYYTMP,#DC=DC,TID=C,#EC=EC,#FC=FC)
.ENDIF,NOFORMS.
$UNLOAD,YYYYTMP.
$SKIP,NOERROR.
  $EXIT.
  $UNLOAD,YYYYTMP.
  $IFE,(EF.EQ.TIE).OR.(EF.EQ.TAE),TERMINATED.
    $EXIT. PRIFILE *TERMINATED*
  $ENDIF,TERMINATED.
  $REVERT,ABORT. PRINT OF LFN FAILED
$ENDIF,NOERROR.
.IFE,FILE(LFN,.NOT.AS),FILEPRM.
  $UNLOAD,LFN.
.ENDIF,FILEPRM.
$REVERT. FILE LFN PRINTED
/EOR
