.;
.; MAKDOC filnam MAKES UP THE .RNO FILE filnam FROM THE LIST FILE filnam.LIS
.;

.ENABLE SUBSTITUTION
.ENABLE QUIET
.;
.; INSTALL THE SPECIAL TASKS WE'LL NEED
.;
INS GETRNO/TASK=...CR1
INS GETKWK/TASK=...CR2
INS KWIK/TASK=...CR3
INS RNOIDX/TASK=...CR4

.;
.; OPEN THE FILE CONTAINING THE LIST OF SOURCE FILES
.;
.SETS DEFDEV ""
.SETS DEFUIC ""
.SETS DEFEXT ".LIS"
@FNAMEPARS/LO 'P1'
.SETS DOCNAM FILE
.SETS DLNAME FILNAM
.SETS DOCIND FILE+".IND"
.SETS DOCTMX FILE+".TMX"
.SETS DOCFIX FILE+".FIX"
.SETS DOCDOC FILE+".DOC"
.SETS DOCTM1 FILE+".TM1"
.SETS DOCRNO FILE+".RNO"
; DEV	'DEV'
; UIC	'UIC'
; FILE	'FILE'
; EXT	'EXT'
; FILNAM 'FILNAM'
; DOCNAM 'DOCNAM'
; DLNAME 'DLNAME'
; DOCIND 'DOCIND'
; DOCTMX 'DOCTMX'
; DOCFIX 'DOCFIX'
; DOCDOC 'DOCDOC'
; DOCTM1 'DOCTM1'
; DOCRNO 'DOCRNO'
PIP 'DOCIND';*/DE
PIP 'DOCRNO';*/DE
.OPENR 'DLNAME'

.;
.; LOOP ARROUND FORMING THE RUNOFF FILE AND THE INDEX FILE
.;
.SETS DEFDEV DEV
.SETS DEFUIC UIC
.SETS DEFEXT ".C"
.READLP:
.READ FNAM
.IFT <EOF> .GOTO LPEX
@FNAMEPARS/LO 'FNAM'
.SETS RNONAM DEV+UIC+FILE+".RNO"
.SETS TMPNAM DEV+UIC+FILE+".TMP"

.; GET THE RUNOFF FILE FROM THE SOURCE
CR1 >'RNONAM' -C 'FILNAM'
.IF <EXSTAT> <> 1 .GOTO COMERR

.; GET THE INDEX FILE FROM THE SOURCE
CR2 >'TMPNAM' -C 'FILNAM'
.IF <EXSTAT> <> 1 .GOTO COMERR

.; APPEND THE INDEX FILE CREATED TO THE NEW INDEX FILE
PIP 'DOCIND'='DOCIND','TMPNAM'
PIP 'TMPNAM';*/DE
PIP 'DOCIND'/PU

.; APPEND THE RUNOFF FILE CREATED TO THE NEW RUNOFF FILE
PIP 'DOCrnO'='DOCRNO','RNONAM'
PIP 'RNONAM';*/DE
PIP 'DOCRNO'/PU

.GOTO READLP

.; CLOSE THE FILE
.LPEX:
.CLOSE

.;
.; MAKE THE KEYWORD LIST
.;
CR3 -T 10 -W 64 <'DOCIND' >'DOCTMX'
.IF <EXSTAT> <> 1 .GOTO COMERR
CR4 <'DOCTMX' >'DOCFIX'
.IF <EXSTAT> <> 1 .GOTO COMERR

.;
.; NOW MAKE THE COMPOSITE RUNOFF FILE CONSISTING OF ALL OTHER FORMED FILES
.;
PIP 'DOCTM1'/NV/ME='DOCNAM'1ST.RNO,'DOCRNO','DOCNAM'HDR.RNO,'DOCFIX'
PIP 'DOCRNO'='DOCTM1'
PIP 'DOCTM1';*/DE
PIP 'DOCFIX';*/DE
PIP 'DOCTMX';*/DE

.;
.; MAKE THE DOC FILE FROM THE .RNO FILE
PIP 'DOCDOC';*/DE
RNO 'DOCDOC'/UL:L/-SP='DOCRNO'
PIP 'DOCRNO'/PU

.;
.; REMOVE THE EXTRA TASKS
.;
REM ...CR1
REM ...CR3
REM ...CR4
REM ...CR2

.;
.EXIT

.;
.; WE HAVE A COMPILE ERROR
.;
.COMERR:
.CLOSE
.OPEN TI:
.ENABLE DATA


******** DOCUMENT ERROR ON 'FNAM' WHILE MAKING 'DOCNAM' *********


.DISABL DATA
.CLOSE
.EXIT
