Google
 

Trailing-Edge - PDP-10 Archives - AP-D348E-SM - sources/execqu.mac
There are 47 other files named execqu.mac in the archive. Click here to see a list.
;<3-EXEC>EXECQU.MAC.234, 11-Nov-77 13:07:05, EDIT BY MILLER
;MAKE /TIME DEFAULT TO ONE HOUR
;<3-EXEC>EXECQU.MAC.233, 10-Nov-77 09:33:37, EDIT BY KIRSCHEN
;UPDATE COPYRIGHT FOR RELEASE 3
;<OSMAN>EXECQU.MAC.1, 29-Aug-77 11:28:56, EDIT BY OSMAN
;DEFAULT LOG FILE DESTINATION TO CONNECTED DIRECTORY
;<3-EXEC>EXECQU.MAC.231, 25-Aug-77 15:55:11, EDIT BY OSMAN
;MAKE "PRINT FOO.BAR,FOO.LST" DELETE FOO.LST, NOT FOO.BAR!!
;<3-EXEC>EXECQU.MAC.230, 23-Aug-77 17:27:28, EDIT BY HURLEY
;MAKE UNIQUE:YES BE THE DEFAULT FOR SUBMIT COMMAND
;<3-EXEC>EXECQU.MAC.229, 19-Aug-77 11:23:58, EDIT BY HURLEY
;FIXED PRINT /REPORT 
;<3-EXEC>EXECQU.MAC.228, 12-Aug-77 14:11:52, EDIT BY OSMAN
;ON "INFO BATCH" COMMAND, QUEUE NAME MIGHT BE 'INPXXX', NOT JUST 'INP' !!
;<3-EXEC>EXECQU.MAC.227,  9-Aug-77 14:25:29, EDIT BY HURLEY
;CLEAN UP FOR RELEASE 3 DOCUMENTATION
;<3-EXEC>EXECQU.MAC.226,  8-Aug-77 14:37:13, EDIT BY OSMAN
;FIX BUG WHEREBY "SUBMIT D60" CAUSED JOBNAME TO BE "D0".
;<3-EXEC>EXECQU.MAC.225,  8-Jul-77 16:27:11, EDIT BY OSMAN
;FIX DEFINITION OF "LOGNAM"
;<3-EXEC>EXECQU.MAC.224,  7-Jul-77 15:34:33, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.223,  7-Jul-77 15:30:41, EDIT BY OSMAN
;PUT IN SET NO DEFAULT (FOR) SUBMIT,PRINT
;<3-EXEC>EXECQU.MAC.222,  7-Jul-77 15:08:41, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.221,  7-Jul-77 15:02:13, EDIT BY OSMAN
;MAKE .DAT FILES IMPLY /FILE:FORTRAN
;<3-EXEC>EXECQU.MAC.220,  7-Jul-77 14:51:29, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.219,  7-Jul-77 14:14:43, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.218,  7-Jul-77 13:44:56, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.217,  7-Jul-77 13:31:40, EDIT BY OSMAN
;IMPLEMENT SET DEFAULT PRINT, SET DEFAULT SUBMIT
;<3-EXEC>EXECQU.MAC.216,  6-Jul-77 13:57:04, EDIT BY OSMAN
;FOR QUASAR VERSION 2, SUPPLY ACCOUNT STRING IN IPCF BLOCK
;<3-EXEC>EXECQU.MAC.215,  5-Jul-77 16:28:24, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.214,  5-Jul-77 16:00:22, EDIT BY OSMAN
;MAKE EXEC UNDERSTAND R2 QUASAR FP/FD'S
;<3-EXEC>EXECQU.MAC.213,  5-Jul-77 15:06:05, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.212,  5-Jul-77 12:16:01, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.211,  5-Jul-77 12:08:05, EDIT BY OSMAN
;DEFINE QV2 AND QV3 TO MAKE EXEC WORK WITH R2 AND R3 QUASAR
;<3-EXEC>EXECQU.MAC.210,  3-Jun-77 11:02:47, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.209, 19-May-77 11:21:38, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.208, 19-May-77 10:30:15, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.207, 12-May-77 11:30:32, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.206, 10-May-77 15:49:32, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.205, 10-May-77 15:02:09, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.204, 10-May-77 14:36:22, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.203, 10-May-77 13:43:20, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.202,  6-May-77 17:07:33, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.201,  6-May-77 16:05:56, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.200,  6-May-77 15:56:24, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.199,  6-May-77 11:46:35, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.198,  6-May-77 11:38:39, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.197,  5-May-77 21:23:00, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.196,  5-May-77 17:07:26, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.195,  5-May-77 16:38:49, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.194,  5-May-77 15:38:19, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.193,  5-May-77 15:21:01, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.192,  4-May-77 22:20:29, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.191,  4-May-77 22:04:30, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.190,  4-May-77 22:00:54, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.189,  4-May-77 21:55:11, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.188,  4-May-77 21:21:02, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.187,  4-May-77 21:12:34, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.186,  4-May-77 20:57:36, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.185,  4-May-77 20:49:45, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.184,  4-May-77 20:39:09, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.183, 29-Apr-77 16:24:55, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.182, 29-Apr-77 15:10:21, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.181, 29-Apr-77 15:05:51, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.180, 22-Apr-77 10:50:35, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.179, 13-Apr-77 13:26:33, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.178, 12-Apr-77 12:57:00, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.177, 12-Apr-77 10:49:49, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.176, 12-Apr-77 10:28:31, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.175, 12-Apr-77 10:02:48, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.174, 12-Apr-77 09:49:58, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.173,  8-Apr-77 18:42:16, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.172,  8-Apr-77 18:41:04, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.171,  8-Apr-77 18:34:26, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.170,  8-Apr-77 18:29:38, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.169,  8-Apr-77 18:16:39, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.168,  8-Apr-77 16:20:35, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.167,  7-Apr-77 16:51:54, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.166,  7-Apr-77 15:56:30, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.165,  7-Apr-77 15:08:39, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.164,  7-Apr-77 13:40:13, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.163,  7-Apr-77 11:38:29, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.162,  6-Apr-77 15:16:36, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.161,  6-Apr-77 15:00:18, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.160,  6-Apr-77 14:07:24, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.159,  6-Apr-77 14:00:59, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.158,  6-Apr-77 13:36:09, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.157,  6-Apr-77 13:34:51, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.157,  6-Apr-77 11:42:58, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.156,  5-Apr-77 16:25:47, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.155,  5-Apr-77 15:07:24, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.154,  5-Apr-77 14:10:18, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.153,  4-Apr-77 17:35:21, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.152,  4-Apr-77 17:26:38, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.151,  4-Apr-77 14:14:26, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.150,  1-Apr-77 15:49:41, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.149,  1-Apr-77 08:43:16, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.148, 31-Mar-77 15:45:46, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.4,  2-Mar-77 14:58:38, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.3,  1-Mar-77 16:29:57, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.2,  1-Mar-77 15:54:49, EDIT BY OSMAN
;<3-EXEC>EXECQU.MAC.1,  1-Mar-77 14:53:37, EDIT BY OSMAN
;TOPS20 'EXECUTIVE' COMMAND LANGUAGE


;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1976, 1977, 1978 BY DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

	SEARCH MONSYM,XDEF,MACSYM,QSRMAC
	;SEE FURTHER SEARCHES WITHIN....
	TTITLE EXECQU

;THIS FILE CONTAINS CODE TO IMPLEMENT COMMANDS WHICH COMMUNICATE
;WITH QUASAR, THE QUEUE SYSTEM..
;PRINT
;SUBMIT
;INFORMATION

;MACRO QV2 USED FOR ASSEMBLING R2 QUASAR DEPENDENT THINGS.
;MACRO QV3 " " "

DEFINE QV2(CODE)<IFL %%.QSR-34,<CODE>>
DEFINE QV3(CODE)<IFGE %%.QSR-34,<CODE>>

QV2 <
	SEARCH SBSMAC
>
QV3 <
	SEARCH GLXMAC
>
DEFINE	QLOAD(A,B,C),<.LDST.(A,B,C,HRRZ,HLRZ,LDB,MOVE)>

DEFINE	QSTOR(A,B,C),<.LDST.(A,B,C,HRRM,HRLM,DPB,MOVEM)>

;MACRO TO STORE VALUE IN A FIELD, AND THEN READ IT BACK TO MAKE SURE
;IT FITS, AND SKIPS IFF SO.

DEFINE VERIFY(A,B,C)<
	QSTOR A,B,C	;;STORE THE VALUE
	PUSH P,A	;;SAVE VALUE WE TRIED TO STORE
	QLOAD A,B,C	;;GET WHAT REALLY GOT STORED
	SUBM A,(P)	;;GET COMPARISON OF VALUES
	POP P,(P)	;;FIX STACK
	SKIPE 1(P)	;;MAKE SURE IT GOT SUCCESSFULLY STORED
>
;SPECIAL BUFFER DEFINITIONS

EQ0==BUF1		;HOLDS QUASAR REQUEST BLOCK
EQGLOB==BUF2		;GLOBAL VALUES FOR REQUEST BLOCK DURING SUBMIT
GLBBLK==EQGLOB+EQHSIZ	;PRINT COMMAND GLOBAL BLOCK
FILMAX==FDXSIZ-1	;MAXIMUM NUMBER OF WORDS FILESPEC MAY TAKE UP
			;ALLOWS FOR MANY ^V'S, AND OBNOXIOUSLY LONG
			;NAMES
LSTBLK==BUF3		;HOLDS VALUES DURING EXPANSION OF WILDCARDS
QV2 <
LOGNAM==EQHSIZ+FPXSIZ+1+FILMAX+FPXSIZ	;OFFSET INTO PAGE TO WHERE LOG FILE NAME GOES
   >
QV3 <
LOGNAM==EQHSIZ+FPXSIZ+1+FILMAX+FPXSIZ+1	;OFFSET INTO PAGE TO WHERE LOG FILE NAME GOES
   >
;AC USAGE
;	Q1	FILE PARAMETER BLOCK ADDRESS (LOCAL FILE OR GLOBAL BLOCK)
;	P1	REQUEST HEADER ADDRESS (GLOBAL OR LOCAL IF SUBMIT COMMAND)
;	P2	FILE PARAMETER ADDRESS

;PRINT (FILE) /SW/SW FILE /SW/SW/SW FILE FILE,FILE ....
;SUBMIT "	"	"
;SWITCHES MAY APPEAR ANYWHERE ON THE LINE.  THERE ARE TWO TYPES OF
;SWITCHES, FILE SWITCHES AND JOB SWITCHES.  FILE SWITCHES APPEARING
;BEFORE ANY FILE HAS BEEN ENTERED APPLY TO ALL FILES IN THE COMMAND.
;THAT IS, THEY ARE GLOBAL FILE SWITCHES.  ANY FILE SWITCH ENTERED
;SUBSEQUENT TO SOME FILESPEC ONLY APPLIES TO THE MOST RECENT FILE SPEC
;BEFORE IT ON THE LINE.  JOB SWITCHES MEAN THE SAME ANYWHERE ON THE
;LINE.
;FOR SUBMIT COMMAND, ALL SWITCHES ARE "FILE" SWITCHES.

.SUBMI::	SKIPE OQCF
	JRST QCM		;USER DISALLOWED NEW STUFF
	NOISE <BATCH JOB>
	MOVEI P4,1		;1 FOR SUBMIT, 0 FOR PRINT
	JRST X1
.PRINT::	SKIPE OQCF
	JRST QCM		;USER DISALLOWED NEW STUFF
	NOISE (FILES)
	MOVEI P4,0
X1:	TLZ Z,F1		;FILE FLAG, COMES ON IF WE'VE SEEN A FILESPEC
	CALL PRINI		;INITIALIZE BLOCKS
PR1:	DEXTX <CTL>		;DEFAULT EXTENSION FOR BATCH FILES
	CAIN P4,0		;DON'T SET THIS DEFAULT UNLESS "SUBMIT"
	DEXTX <>		;NO DEFAULT EXTENSION FOR PRINT REQUESTS
	MOVX A,GJ%OLD+GJ%IFG+GJ%FLG	;ALLOW *'S AND RETURN FLAGS,FILE MUST EXIST
	MOVEM A,CJFNBK+.GJGEN	;STORE FLAGS
	MOVEI B,[FLDDB. .CMCFM,,,,,[	;END OF LINE ONE POSSIBILITY
	FLDDB. .CMSWI,,$JOBSW,<Job switch,>,,[	;JOB SWITCH
	FLDDB. .CMSWI,,$FILSW,<File switch,>,,[	;FILE SWITCH
	flddb. .cmcma,,,,,[	;comma is optional
	FLDDB. .CMFIL,CM%SDH,,<File specification>]]]]]		;FILESPEC ANOTHER POSSIBILITY
	CAIE P4,0		;DIFFERENT TABLES FOR SUBMIT COMMAND
	MOVEI B,[FLDDB. .CMCFM,,,,,[	;END OF LINE ONE POSSIBILITY
	FLDDB. .CMSWI,,$SFLSW,<Switch,>,,[	;Switch
	flddb. .cmcma,,,,,[	;comma is optional
	FLDDB. .CMFIL,CM%SDH,,<File specification>]]]]		;FILESPEC ANOTHER POSSIBILITY
	tlnn z,f1		;have we seen a filespec yet?
	hrrz b,(b)		;no, so confirmation invalid here
	CALL FIELD		;SEE WHAT THE USER TYPED
	TXNE A,CM%NOP		;MAKE SURE SOMETHING GOOD GOT TYPED
	 JRST BADQ		;BAD COMMAND
	LDB D,[331100,,.CMFNP(C)]	;FIND OUT WHAT GOT TYPED
	CAIN D,.CMCMA		;COMMA?
	 JRST PR1		;YES, JUST IGNORE IT
	CAIN D,.CMCFM		;END OF LINE?
	 JRST PRIEOL		;YES
	CAIN D,.CMFIL		;A FILE?
	 JRST PRIFIL		;YES
	MOVE D,.CMDAT(C)	;A SWITCH, SEE WHICH TYPE
	CAIN D,$JOBSW		;JOB SWITCH?
	 JRST PRIJOB		;YES
	JRST PRIFS		;NONE OF THE ABOVE, MUST BE A FILE SWITCH

BADQ:	CAIN P4,0		;DIFFERENT ERROR MESSAGE DEPENDING ON COMMAND
	 CMERRX <Invalid PRINT command>
	CAIN P4,1
	 CMERRX <Invalid SUBMIT command>

;A FILE SWITCH HAS BEEN TYPED.  IF NO FILENAMES HAVE BEEN TYPED, THIS
;SWITCH SHOULD BE CONSIDERED GLOBAL.  OTHERWISE, THIS SWITCH ONLY
;APPLIES TO THE LAST FILE SEEN.

PRIFS:
SWIDSP:	CALL EXSWI		;EXECUTE THE SWITCH
	JRST PR1	;GO BACK FOR MORE FIELDS

;JOB SWITCH SEEN

PRIJOB:	JRST SWIDSP	;DISPATCH ON PARTICULAR SWITCH FLAVOR

;FILESPEC SEEN.

PRIFIL:	MOVE A,B
	CALL JFNSTK	;REMEMBER THE JFN, SO IT GOES AWAY LATER
	MOVE B,A
	TLO Z,F1	;NOTE THAT FILE SEEN
	MOVEI A,FIL22	;DON'T REALLY PROCESS IT UNTIL PASS 2
	PUSH P,B		;SAVE JFN
	CALL STOR1
	POP P,B			;GET JFN AGAIN
	JUMPN P4,PR1		;RETURN NOW IF DOING SUBMIT
	TXNE B,GJ%EXT		;STARS IN EXTENSION?
	JRST PR1		;YES, SO DON'T ASSUME /DELETE
	HRRZ B,B		;GET JFN (AGAIN)
	MOVX C,1B11		;WE WANT THE EXTENSION
	MOVE A,CSBUFP		;WRITE IT INTO FREE SPACE
	JFNS			;GET EXTENSION
	MOVE A,CSBUFP
	HRROI B,[ASCIZ /LST/]	;SEE IF EXTENSION IS "LST"
	STCMP
	CAIN A,0		;SKIP IF NOT .LST
	CALL .DELET		;IS, SO DEFAULT IS "/DELETE"
				;SLIGHT BUG HERE.  IF COMMAND IS
			;"PRINT FOO.*", /DELETE WILL NEVER BE ASSUMED
	MOVE A,CSBUFP		;GET EXTENSION AGAIN
	HRROI B,[ASCIZ /DAT/]	;SEE IF IT'S A FORTRAN DATA FILE
	STCMP
	CAIN A,0		;IS IT?
	CALL FORT		;YES
	JRST PR1

FIL22:	MOVEI P1,EQ0		;WAS POINTING AT GLOBAL BLOCK IF SUBMIT COMMAND
	PUSH P,B		;SAVE THE NEW JFN
	SKIPE PRIJFN		;ANY PREVIOUS FILESPEC?
	CALL FILDO		;FINISH LAST FILE
	move q1,p2		;from now on all switches are local
	POP P,PRIJFN		;SAVE JFN AWAY
	JUMPN P4,SUBGLB		;MUST MOVE ENTIRE PAGE IF SUBMIT COMMAND
	HRLI A,GLBBLK	;GET ADDRESS OF GLOBAL INFO BLOCK
	HRR A,P2		;AND ADDRESS OF NEW FILE PARAMETER BLOCK
	BLT A,FPXSIZ-1(P2)	;MOVE GLOBAL PARAMETERS INTO NEW BLOCK
FIL0:	CALL FILBLK		;FILL IN INFO FOR THIS FILE
	 RET		;WAIT FOR SWITCHES BEFORE MORE PROCESSING

SUBGLB:	MOVE A,[EQGLOB,,EQ0]	;MOVE FROM GLOBAL AREA INTO LOCAL AREA
	BLT A,EQ0+777
	JRST FIL0		;REJOIN COMMON CODE

;ROUTINE TO FINISH LAST CURRENT FILESPEC.  MUST BE CALLED BEFORE NEW
;FILSPEC CAN BE PROCESSED, BUT NOT EARLIER, SINCE SWITCHES SYNTACTICALLY
;FOLLOW FILESPECS.

FILDO:	JUMPN P4,FILDO1		;FOR SUBMIT, ENTIRE PAGE MUST BE REMEMBERED
	HRLI A,(P2)
	HRRI A,LSTBLK
	BLT A,LSTBLK+FPXSIZ-1	;REMEMBER FILE PARAMETER'S IN CASE *'S
	JRST PRF1

FILDO1:	MOVE A,[EQ0,,LSTBLK]
	BLT A,LSTBLK+777	;REMEMBER ENTIRE PAGE

PRF1:	jumpn p4,nosiz		;don't mess with file sizes on submit command
	QLOAD A,.FPINF(P2),FP.FCY	;GET NUMBER OF COPIES WANTED FOR THIS FILE
	IMUL A,FSIZE		;MULTIPLY BY FILE SIZE TO GET REQUEST SIZE FOR THIS FILE
	QLOAD B,.EQLM2(P1),EQ.NBL
	ADD B,A		;ADD IN THIS FILE'S SIZE TO GRAND TOTAL
	VERIFY B,.EQLM2(P1),EQ.NBL	;PUT BACK TOTAL MAKING SURE IT FITS
	 ERROR <Too many file pages being requested at once>
NOSIZ:	CAIE P4,0		;BATCH REQUEST?
	CALL SUBLOG		;YES, FILL IN LOG FILE BLOCK
BAKLOG:	CALL NEWBLK		;GET NEW PARAMETER BLOCK FOR NEXT FILE
	MOVE A,PRIJFN
	GNJFN		;SEE IF ANY MORE FILES ASSOCIATED WITH THIS JFN
	 RET		;ON GNJFN FAILURE, ASSUME NO MORE FILES FOR THIS JFN
	CALL FILBLK	;FILL IN PARAMETERS FOR THIS FILE
	JRST PRF1	;SEE IF MORE FILES ON THIS JFN

;fill in log file data

sublog:	STKVAR <CONDN>		;HOLDS CONNECTED DIRECTORY NUMBER
	CALL NEWBLK		;ALLOCATE FILE BLOCK FOR LOGFILE-NAME
	SKIPE LOGNAM(P1)	;LOGFILE NAME ALREADY SPECIFIED?
	JRST FILBK1		;YES
	GJINF			;GET CONNECTED DIRECTORY NUMBER
	MOVEM B,CONDN		;SAVE IT
	CALL GETFP		;GET POINTER TO WHERE FILENAME GOES
	MOVE B,CONDN		;GET CONNECTED DIRECTORY
	DIRST			;LOGFILE GOES IN THAT DIRECTORY BY DEFAULT
	 ERCAL JERR		;SHOULDN'T FAIL
	hrrz b,prijfn		;use control file as source
	movx c,1B8+js%paf	;get NAME
	jfns			;get string for beginning of name
	hrroi b,[asciz /.LOG/]	;standard extension is .log
	movei c,0		;put null after it
	sout			;finish making filespec
	jrst filbk1		;join common code to finish fileblock

;ROUTINE WHICH FILES IN PARAMETERS FOR FILE ASSOCIATED WITH JFN IN PRIJFN

FILBLK:	HRRZ B,PRIJFN	;GET JFN BACK AGAIN
	CAIE P2,EQ0+EQHSIZ	;ARE WE ON FIRST FILESPEC OF REQUEST?
	JRST FILBK2		;NO
	MOVE A,CSBUFP		;GET SOME SPACE INTO WHICH TO WRITE FILENAME
	MOVSI C,(1B8)	;WE WANT JUST FILENAME FIELD, UNPUNCUATED
	JFNS		;GET THE NAME
	CALL SIXJOB	;CHANGE FILENAME INTO JOB NAME
filbk2:	CALL GETFP	;GET POINTER TO WHERE STRING GOES
	MOVX C,1B2+1B5+1B8+1B11+1B14+JS%PAF	;WE WANT COMPLETE FILESPEC, PUNCTUATED
	HRRZ B,PRIJFN		;GET JFN
	JFNS		;STORE THE NAME
filbk1:
QV3 <
	SUBI A,FPXSIZ+.FDFIL-2(P2);CALCULATE NUMBER OF WORDS USED FOR FILESPEC
	AOJ A,			;LEAVE ROOM FOR ONE LENGTH WORD
   >
QV2 <
	SUBI A,FPXSIZ-2(P2)
   >
	CAIE P4,0
	MOVEI A,FILMAX+1		;FOR SUBMIT, FILESPEC AREA IS FIXED LENGTH
QV2 <
	QSTOR A,.FPSIZ(P2),FP.FFS
   >
QV3 <
	QSTOR A,FPXSIZ+.FDLEN(P2),FD.LEN	;REMEMBER LENGTH OF FILENAME
   >
	ADDI A,FPXSIZ	;GET TOTAL SIZE FOR THIS FILE
	QLOAD B,.MSTYP(P1),MS.CNT	;GET OLD MESSAGE LENGTH
	ADD B,A		;GET INCREASED LENGTH DUE TO NEW FILE
	QSTOR B,.MSTYP(P1),MS.CNT	;STORE NEW LENGTH
	QLOAD A,.EQSPC(P1),EQ.NUM	;GET NUMBER OF FILES IN REQUEST
	AOJ A,		;COUNT THE NEW FILE
	QSTOR A,.EQSPC(P1),EQ.NUM	;STORE NEW FILE COUNT
	jumpn p4,nofdb	;don't get size of file if submit command
	HRRZ A,PRIJFN	;GET THE JFN AGAIN
	MOVE B,[1,,.FBBYV]	;FILE SIZE IN PAGES
	MOVEI C,C	;FILE SIZE IN PAGES
	GTFDB		;READ THE FILE INFO
	 ERCAL JERR	;PRINT ERROR MESSAGE IF CAN'T DO GTFDB
	QSTOR C,FSIZE,FB%PGC	;STORE PAGE COUNT
nofdb:	RET

;ROUTINE TO PUT POINTER IN A TO WHERE FILENAME STRINGS SHOULD
;GO IN QUASAR REQUEST BLOCK

GETFP:
QV3 <
	HRROI A,FPXSIZ+.FDFIL(P2)	;GET ADDRESS OF WHERE NAME IS TO BE STORED
   >
QV2 <
	HRROI A,FPXSIZ(P2)	;ONLY ONE LENGTH WORD IN R2
   >
	RET

SIXJOB:	MOVE A,CSBUFP	;POINTER TO READ FILENAME
	MOVE B,[440600,,CREJOB]	;SIXBIT POINTER FOR JOBNAME
	setzm CREJOB;clear any old entry
SIX1:	call cackle	;READ A CHARACTER
	 RET		;DONE ON NULL
	JUMPL C,SIX1	;IF "^V", GO GET CHARACTER BEING QUOTED
	TLNN B,770000	;MAKE SURE THERE'S ROOM FOR ANOTHER CHARACTER
	JRST R	;NO
	IDPB C,B	;YES, SAVE CHARACTER
	JRST SIX1	;GO GET NEXT CHARACTER

;ROUTINE TO SET UP P2 TO POINT AT A NEW FILE PARAMETER BLOCK.  IF
;THIS NEW BLOCK IS TOO CLOSE TO THE END OF A PAGE, THE CURRENT PAGE
;IS SENT OFF TO QUASAR, AND A NEW ONE STARTED.

NEWBLK:
QV2 <
	QLOAD A,.FPSIZ(P2),FP.FFS
   >
QV3 <
	QLOAD A,FPXSIZ+.FDLEN(P2),FD.LEN	;GET SPACE USED FOR LAST FILESPEC
   >
	ADDI P2,FPXSIZ(A)	;NOT FIRST FILE, LEAVE ROOM FOR PARAMETER AREA
	JUMPE P4,NOTSUB		;ON SUBMIT, ONLY SINGLE BATCH FILE AND LOG FILENAME CAN BE SENT AT A TIME
	QLOAD A,.EQSPC(P1),EQ.NUM	;GET NUMBER OF FILES SO FAR
	CAIN A,2		;SUBMIT COMMAND.  DO WE HAVE EXACTLY 2 FILES?
	JRST NEW1		;YES, SO SHIP THE PAIR OFF TO QUASAR
NOTSUB:	MOVEI A,100+FPXSIZ(P2)	;GET WORST CASE LAST ADDRESS OF NEW PARAMETER BLOCK
	CAIL A,1000(P1)	;BEYOND END OF REQUEST BLOCK?
NEW1:	CALL SHPOFF		;YES, SO SEND THIS ONE TO MAKE MORE ROOM
	HRLI A,LSTBLK	;GET ADDRESS OF LAST FILEBLOCK
	JUMPN P4,NEW2		;FOR SUBMIT, ENTIRE PAGE MUST BE COPIED
	HRR A,P2
	BLT A,FPXSIZ-1(P2)	;WHEN EXPANDING *'S, USE SAME PARAMETERS FOR EACH FILE
NEW3:	RET

NEW2:	QLOAD B,.EQSPC(P1),EQ.NUM	;GET NUMBER OF FILES SO FAR IN REQUEST
	CAIE B,0		;DID SUBMIT REQUEST JUST GET SENT?
	RET			;NOT YET, SO DON'T RESET BLOCK YET
	HRRI A,EQ0
	BLT A,EQ0+777
	TLNN Z,F2		;EXPLICIT JOB NAME SPECIFIED?
	SETZM EQ0+.EQJOB		;NO, CLEAR IT SO IT GETS RECOMPUTED
	MOVEI A,0
	QSTOR A,.EQSPC(P1),EQ.NUM	;CLEAR NUMBER OF FILES
	MOVEI A,EQHSIZ	;LENGTH OF MESSAGE IS EQHSIZ
	QSTOR A,(P1),MS.CNT	;GETS INCREMENTED AS WE ADD FILESPECS TO REQUEST
	JRST NEW3

SHPOFF:	SKIPE .EQJOB(P1);JOBNAME SPECIFIED YET?
	 JRST SHP9		;YES, SO IT'S ALREADY CORRECT
	MOVE A,CREJOB	;NO, SO SET JOBNAME TO FILENAME
	MOVEM A,.EQJOB(P1)	;NO, SET TO FIRST FILE IN REQUEST
SHP9:	QLOAD A,.EQSPC(P1),EQ.NUM	;GET NUMBER OF FILES IN REQUEST
	JUMPE A,R		;DON'T SEND BLOCK IF NO FILES IN REQUEST
	MOVE A,[EQ0,,IPCFP]	;MOVE REQUEST BLOCK
	BLT A,IPCFP+777		;INTO PAGE FOR IPCF SEND
	CALL QUASND		;SEND TO QUASAR AND PRINT RESPONSE
	MOVEI P2,EQHSIZ(P1)	;RESET FILE PARAMETER POINTER
	MOVEI A,0
	QSTOR A,.EQLM2(P1),EQ.NBL	;RESET PAGE COUNTER
	QSTOR A,.EQSPC(P1),EQ.NUM	;CLEAR NUMBER OF FILES
	MOVEI A,EQHSIZ	;LENGTH OF MESSAGE IS EQHSIZ
	QSTOR A,(P1),MS.CNT	;GETS INCREMENTED AS WE ADD FILESPECS TO REQUEST
	RET

;ROUTINE TO SEND REQUEST TO QUASAR AND PRINT RESPONSE

QUASND:	MOVEI A,.QOCRE		;SPECIFY WE'RE MAKING A REQUEST
	MOVE B,QSRPID		;SEND TO QUASAR
	CALL SNDMS1		;SEND THE REQUEST
	 CALL CJERR		;FAILED, TELL USER WHY
	CALL PRITXT		;PRINT THE TEXT MESSAGE
	RET

;END OF LINE SEEN.  SHIP THE BLOCK OFF TO QUASAR, GET MESSAGE BACK,
;TYPE IT, CLEAN UP, AND RETURN.

PRIEOL:	CALL GROVEL		;PROCESS ALL THE ARGUMENTS
	CALL FILDO		;FINISH LAST FILESPEC
	CALL SHPOFF		;SHIP OFF THE LAST BLOCK
QCLEAN:	CALL KILPID		;GET RID OF PIDS
	CALL UNMAP		;UNMAP SPECIAL PAGES WE USED
	CALL RLJFNS		;GET RID OF JFN'S WE USED
	RET			;ALL DONE

;THIS ROUTINE GETS EXECUTED AFTER END OF LINE SEEN TO DO THE ACTUAL
;EXECUTING OF THE QUEUE-CLASS COMMAND.  THE REASON WE CAN'T EXECUTE AS WE
;GO ALONG IS THAT IF THINGS LIKE *.* ARE TYPED, THEY MAY TAKE MORE
;THAN ONE IPCF MESSAGE TO HANDLE ALL OF THEM, BUT SENDING THE IPCF
;MESSAGES OFF IMMEDIATELY WOULD CAUSE THE USER'S COMMAND TO START
;EXECUTING BEFORE HE TYPES CONFIRMATION, SO THAT HE MAY TYPE ^C OR
;^U, EXPECTING TO CANCEL THE COMMAND, AND SOME FILES MAY HAVE ALREADY
;BEEN SUBMITTED!

GROVEL:	STKVAR <CURPTR>		;HOLDS END OF ARG LIST
	MOVE A,QPT		;GET POINTER TO END OF ARG LIST
	MOVEM A,CURPTR		;REMEMBER WHERE IT ENDS
	TLZ Z,F1+F2		;NO FILESPEC SEEN YET OR /JOBNAME
	movei q1,glbblk		;switches global until filespec seen
	CAIE P4,0
	MOVEI P1,EQGLOB		;FOR SUBMIT, P1 FIRST POINTS TO GLOBAL PAGE
	MOVE Q2,[IOWD QSLEN,DPSTK]	;FIRST ASSUME GETTING DEFAULT PRINT ARGS
	CAIE P4,0
	MOVE Q2,[IOWD QSLEN,DSSTK]	;NO, WE'RE DOING SUBMIT
	MOVE A,DPPT		;GET POINTER TO END OF PRINT DEFAULTS
	CAIE P4,0
	MOVE A,DSPT		;THIS IS SUBMIT, SO GET SUBMIT DEFAULTS
	MOVEM A,QPT		;REMEMBER WHERE END OF DEFAULT LIST IS
	CAIE A,0		;PERHAPS THERE ARE NO DEFAULTS!
	CALL GROVEX		;GROVEL THROUGH THE DEFAULTS
	MOVE A,CURPTR
	MOVEM A,QPT		;SET END OF CURRENT ARGS
	MOVE Q2,[IOWD QSLEN,QSTK]	;POINTER TO ARG LIST
	CALLRET GROVEX		;GROVEL THROUGH REAL ARGS

GROVEX:	ADJSP Q2,-2		;SO FIRST INCREMENT GETS TO BEGINNING
GRV1:	ADJSP Q2,3		;POINT TO NEXT ENTRY
	CAML Q2,QPT		;STILL IN THE STACK ?
	RET			;NOPE-GO AWAY
	DMOVE A,(Q2)		;ADDRESS IN A, DATA IN B
	MOVE C,2(Q2)		;SECOND WORD OF DATA IN C
	CALL (A)		;PROCESS THE DATA
	JRST GRV1		;TRY AGAIN

;ROUTINE TO STORE PARSED DATA ON ARG STACK

STOR1:	MOVE D,QPT		;GET POINTER
	PUSH D,A		;STORE DISPATCH ADDRESS
	 ERCAL TMA		;TOO MANY ARGUMENTS
	PUSH D,B		;STORE FIRST WORD OF DATA
	 ERCAL TMA
	PUSH D,C		;STORE SECOND WORD OF DATA
	 ERCAL TMA
	MOVEM D,QPT		;REMEMBER NEW VALUE OF POINTER
	RET

TMA:	ERROR <Too many filespecs or switches, break into several commands>

;ROUTINE TO INTERPRET MESSAGE FROM QUASAR, AND PRINT MESSAGE IF
;IT'S A TEXT MESSAGE.

PRITXT:	CALL IPCRCV		;GET ANSWER
	QLOAD A,IPCFP+.MSTYP,MS.TYP	;GET MESSAGE TYPE
QV2 <
	CAIE A,.QOTEX	;MAKE SURE IT'S TEXT
	ERROR <Unexpected response from QUASAR>
	QLOAD A,IPCFP,MS.TYP	;GET TYPE OF MESSAGE
	HRROI B,IPCFP+TEX.MS	;GET POINTER TO MESSAGE
	MOVE A,IPCFP+TEX.ST	;GET MESSAGE CONTROL BITS
	TXNE A,TX.NMS		;ANY MESSAGE?
	 JRST PRI2		;NO, SO WE MIGHT BE DONE
	TXNN A,TX.FAT+TX.WRN	;NOT WARNING OR FATAL ERROR?
	JRST PRIT1	;RIGHT, SO JUST PRINT INFORMATIONAL MESSAGE
	TXNE A,TX.FAT	;FATAL?
	UERR (B)	;RIGHT, SO PRINT MESSAGE AS AN ERROR
	UETYPE [ASCIZ /%%%2M
/]			;WARNING MESSAGE, PRINT AS SUCH
PRI2:	TXNE A,TX.MOR		;MORE?
   >
QV3 <
	CAIE A,MT.TXT	;MAKE SURE IT'S TEXT
	ERROR <Unexpected response from QUASAR>
	QLOAD A,IPCFP,MS.TYP	;GET TYPE OF MESSAGE
	HRROI B,IPCFP+.MSDAT	;GET POINTER TO MESSAGE
	MOVE A,IPCFP+.MSFLG	;GET MESSAGE CONTROL BITS
	TXNE A,MF.NOM		;ANY MESSAGE?
	 JRST PRI2		;NO, SO WE MIGHT BE DONE
	TXNN A,MF.FAT+MF.WRN	;NOT WARNING OR FATAL ERROR?
	JRST PRIT1	;RIGHT, SO JUST PRINT INFORMATIONAL MESSAGE
	TXNE A,MF.FAT	;FATAL?
	UERR (B)	;RIGHT, SO PRINT MESSAGE AS AN ERROR
	UETYPE [ASCIZ /%%%2M
/]			;WARNING MESSAGE, PRINT AS SUCH
PRI2:	TXNE A,MF.MOR		;MORE?
   >
	JRST PRITXT		;YES GO GET IT
	RET			;NO, WE'RE DONE

PRIT1:	UETYPE [ASCIZ /[%2M]
/]
	JRST PRI2

;LIST OF PRINT COMMAND SWITCHES

DEFINE SLIST
<
	JOBS <TV AFTER>	;PRINT AFTER THIS TIME
	FILS <TV BEGIN,,.PB>	;BEGIN ON SPECIFIC PAGE
	FILS <TV COPIES>	;HOW MANY COPIES
REPEAT 0,<
	JOBS <TV DEADLINE>	;LATEST ACCEPTABLE TIME FOR REQUEST TO BE PROCESSED
>
	FILS <t DELETE>	;DELETE FILE AFTER PRINTING
	FILS <TV FILE>		;WHICH TYPE OF FILE IT IS
	JOBS <TV FORMS>	;KIND OF PAPER TO USE
	FILS <T HEADER>	;HEADER LINE FLAVOR
	JOBS <TV JOBNAME,,.GOBNA>	;SPECIFY NON-DEFAULT JOBNAME
	JOBS <TV LIMIT>	;NUMBER OF PAGES TO ALLOW TO BE PRINTED
	JOBS <T LOWERCASE,,.LOWER>	;PRINT FILE ONLY ON PRINTER WITH UPPER-LOWER CAPABILITY
	FILS <T NOHEADER>
	JOBS <TV NOTE>		;PUT NOTE ON OUTPUT
	FILS <t PRESERVE>	;DON'T DELETE FILE, DEFAULT UNLESS .LST
	FILS <TV PRINT,,.PF>		;PAPER FORMAT CONTROL
REPEAT 0,<
	JOBS <TV PRINTER>	;WHICH PRINTER YOU WANT OUTPUT ON
>
	JOBS <TV PRIORITY>	;PRIORITY LEVEL OF REQUEST
	FILS <TV REPORT>	;PRINT REPORT WITH COBOL REPORT FILE
	FILS <TV SPACING>	;SINGLE OR DOUBLE SPACING
	JOBS <T UPPERCASE>	;SEND TO UPPERCASE PRINTER
	JOBS <TV USER,,.BUSER>	;SPECIAL OWNER FOR THIS REQUEST
>;;END OF DEFINE SLIST

;WHEN THE USER TYPES "?" AFTER THE WORD "PRINT", HE WANTS TO SEE TWO
;DISTINCT LISTS.  HOWEVER, NOTE THAT THERES "/FORMS" IN ONE LIST AND "/FILE" IN
;THE OTHER.  HENCE WHEN USER TYPES "/F$", HE SHOULD GET A DING BECAUSE
;IT'S AMBIGUOUS.  ALSO, "/F" SHOULD BE AN ERROR, FOR THE SAME REASON.
;HOWEVER, THE WAY MONITOR WORKS, "/F" WILL MATCH /FORMS UNIQUELY BECAUSE
;MONITOR DOESN'T CHECK MORE THAN ONE LIST IF SOMETHING MATCHES.  HENCE
;TO MAKE THINGS WORK DESIRABLY, WE MUST INCLUDE ALL SWITCHES IN BOTH
;LISTS, AND ARRANGE FOR EACH LIST TO HAVE THE APPROPRIATE ENTRIES MARKED
;AS "INVISIBLE", SO THAT USER WILL JUST SEE TWO SEPERATE DIFFERENT LISTS
;AND "/F" WILL ACT AMBIGUOUS.  TO DO ALL THIS, THE FOLLOWING HAIR:

DEFINE BUILDF
<
%%C==0		;;1 FOR JOB SWITCHES
BUILD		;;DO THE WORK
>

DEFINE BUILDJ
<
%%C==1		;;0 FOR FILE SWITCHES
BUILD		;;DO THE WORK
>

DEFINE BUILD
<
SLIST		;;BUILD SWITCH TABLE
>

DEFINE JOBS(SWITCH)
<
IFN %%C,<SWITCH>
IFE %%C,<I'SWITCH>	;;MAKE NON-JOB SWITCH INVISIBLE
>

DEFINE FILS(SWITCH)
<
IFN %%C,<I'SWITCH>
IFE %%C,<SWITCH>
>

;TABLE OF FILE SWITCHES

$FILSW:	TABLE
	BUILDF		;BUILD TABLE OF FILE SWITCHES
	TEND

;TABLE OF JOB SWITCHES FOR PRINT COMMAND

$JOBSW:	TABLE
	BUILDJ		;BUILD JOB SWITCH TABLE
	TEND

;BEGIN ON SPECIFIC PAGE OF FILE

.PB:	DECX <Decimal page number of file on which to start listing>
	 CMERRX
	MOVEI A,PB2
	CALLRET STOR1

PB2:	MOVEM B,.FPFST(P2)
	RET

;LIMIT NUMBER OF SPOOLED OUTPUT PAGES BATCH JOB MAY WRITE

.CARDS:	DECX <Decimal number of spooled output pages job is allowed to print>
	 CMERRX
	VERIFY B,C,EQ.LPT	;VERIFY RANGE
	 ERROR <Page limit out of range>
	MOVEI A,CAR2
	CALLRET STOR1

CAR2:	QSTOR B,.EQLM3(P1),EQ.LPT
	RET

;NUMBER OF CORE PAGES JOB IS ALLOWED TO USE

.CORE:	DECX <Decimal number of memory pages job is allowed to use>
;NUMBER OF COPIES OF FILE DESIRED
	 CMERRX
	VERIFY B,C,EQ.COR
	 ERROR <Memory limit out of range>
	MOVEI A,COR2
	CALLRET STOR1

COR2:	QSTOR B,.EQLM2(P1),EQ.COR
	RET

;TIME BY WHICH REQUEST MUST START BEING PROCESSED

.DEADL:	CALL GDEAD	;READ DEADLINE
	MOVEI A,DEA2
	CALLRET STOR1

DEA2:	MOVEM B,.EQDED(P1)
	RET

GDEAD:	DTX <Date and time before which request must start being processed>
	 CMERRX <Invalid DEADLINE value>
	RET

;SPECIFY DEPENDENCY COUNT

.DEPEN:	DECX <Decimal DEPENDENCY-COUNT>
	 CMERRX <Invalid DEPENDENCY-COUNT>
	VERIFY B,C,EQ.DEP	;VERIFY RANGE
	 ERROR <DEPENDENCY-COUNT out of range>
	MOVEI A,DEP2
	CALLRET STOR1

DEP2:	QSTOR B,.EQLM1(P1),EQ.DEP
	RET

;NUMBER OF FEET OF PAPER TAPE (SPOOLED) JOB IS ALLOWED TO PUNCH

.FEET:	DECX <Decimal number of feet of spooled paper tape job is allowed to punch>
	 CMERRX <Invalid FEET value>
	VERIFY B,C,EQ.PTP
	 ERROR <FEET value out of range>
	MOVEI A,FE2
	CALLRET STOR1

FE2:	QSTOR B,.EQLM4(P1),EQ.PTP
	RET

;SPECIFY WHETHER LOG FILE SHOULD BE PRINTED

.OUTPU:	KEYWd $OUTPU
	 0		;NO DEFAULT
	CMERRX <Invalid value for /OUTPUT switch>
	MOVE B,P3	;GET VALUE FOR SWITCH
	MOVEI A,OUT2
	CALLRET STOR1

OUT2:	QSTOR B,.EQLM1(P1),EQ.OUT
	RET

$OUTPU:	TABLE
	T ALWAYS,,%EQOLG
	T ERRORS,,%EQOLE
	T NOLOG,,%EQONL
	TEND

;SPECIFY HOW MUCH SPOOLED LINEPRINTER OUTPUT JOB MAY WRITE

.PAGE:	DECX <Decimal number of spooled lineprinter pages job may write>
	 CMERRX <Invalid PAGE value>
	VERIFY B,C,EQ.LPT
	 ERROR <PAGE count out of range>
	MOVEI A,PAG2
	CALLRET STOR1

PAG2:	QSTOR B,.EQLM3(P1),EQ.LPT
	RET

;SPECIFY PROTECTION OF REQUEST

.PROTE:	OCTX <Octal protection number for request>
	 CMERRX <Invalid PROTECTION>
	VERIFY B,C,EQ.PRO	;check range
	 ERROR <PROTECTION out of range>
	MOVEI A,PRO2
	CALLRET STOR1

PRO2:	QSTOR B,.EQSPC(P1),EQ.PRO
	RET

;SPECIFY WHETHER JOB IS RESTARTABLE OR NOT

.RESTA:	CALL GRES		;GET RESTARTABLE VALUE
	MOVEI A,RES2
	CALLRET STOR1

RES2:
QV2 <
	QSTOR B,.EQLM1(P1),EQ.NRS
   >
QV3 <
	QSTOR B,.EQLM1(P1),EQ.RST
   >
	RET

GRES:	KEYWD $YESNO
QV2 <
	 T YES,,0			;DEFAULT IS YES
   >
QV3 <
	T YES,,%EQRYE
   >
	 CMERRX <YES or NO required>
	HRRZ B,P3		;RETURN REPONSE IN B
	RET

$YESNO:	TABLE
QV2 <
	T NO,,1
	T YES,,0
   >
QV3 <
	T NO,,%EQRNO
	T YES,,%EQRYE
   >
	TEND

;TIME LIMIT FOR JOB

.TIME:	DEFX <1:00:00>		;SET UP A DEFAULT FOR RUN TIME
	CALL GTIME		;GET TIME IN SECONDS
	MOVEI A,TIM2
	CALLRET STOR1

TIM2:	QSTOR B,.EQLM2(P1),EQ.TIM
	RET

;ROUTINE TO INPUT TIME IN SECONDS INTO B.

GTIME:	TIMEX <Time limit for job in form hh:mm:ss>
	 CMERRX <Invalid TIME>
	MOVEI D,0		;NO SPECIAL CONTROL
	ODCNV			;GET NUMBER OF SECONDS
	HRRZ B,D		;LEAVE SECONDS IN B
	VERIFY B,C,EQ.TIM	;MAKE SURE IT FITS IN FIELD
	 ERROR <TIME out of range>
	RET

;SPECIFY PLOTTER TIME ALLOWED

.TPLOT:	DECX <Decimal number of plotter minutes job is to be allowed>
	 CMERRX <Invalid TPLOT value>
	VERIFY B,C,EQ.PLT	;check range
	 ERROR <TPLOT value out of range>
	MOVEI A,PLO2
	CALLRET STOR1

PLO2:	QSTOR B,.EQLM4(P1),EQ.PLT
	RET

;SPECIFY UNIQUENESS OF JOB

.UNIQU:	CALL GUNI	;GET UNIQUENESS VALUE
	MOVEI A,UNI2
	CALLRET STOR1

UNI2:	QSTOR B,.EQLM1(P1),EQ.UNI
	RET

GUNI:	DECX <UNIQUEness value, 0 or 1>
	 CMERRX <Invalid UNIQUEness value>
QV3 <
	AOJ B,			;IN R3, 0 IS INVALID 1 IS NO 2 IS YES
				;THIS SWITCH SHOULD REALLY BE CHANGED TO
				;/UNIQUE:YES OR /UNIQUE:NO
   >
	VERIFY B,C,EQ.UNI
	 ERROR <UNIQUEness value out of range>
	RET

;SPECIFY LINE OF CONTROL FILE ON WHICH TO BEGIN EXECUTION

.SBEG:	DECX <Decimal line number of control file on which to start processing>
	 CMERRX <Invalid line number>
	MOVEI A,SB2
	CALLRET STOR1

SB2:	MOVEM B,.FPFST(Q1)
	RET

;SPECIAL LOG FILE NAME
;BUG HERE:  "SET DEFAULT SUBMIT /LOGNAME:FOO" DOESN'T WORK BECAUSE
;RLJFNS/FLJFNS WILL PREMATURELY FLUSH THE JFN.  NOTE THAT EVEN IF
;EXEC KNEW NOT TO FLUSH IT, USER GIVING "CLOSE" COMMAND WOULD FLUSH
;IT.  E.O. 7/7/77

.LFN:	movei a,[asciz /log/]	;default extension for log file
	call coutfn
	 cmerrx <Invalid log file name>
	MOVE B,A		;PUT JFN IN AC2
	MOVEI A,LFN2
	CALLRET STOR1		;JUST STORE JFN ON FIRST PASS

LFN2:	HRROI A,LOGNAM(P1)	;ON SECOND PASS, POINT TO NAME AREA
	MOVX C,1B2+1B5+1B8+1B11+1B14+JS%PAF
	JFNS			;AND WRITE ENTIRE NAME INTO LOG FILE AREA
	RET

;TAG AT WHICH TO BEGIN PROCESSING BATCH REQUEST

.TAG:	WORDX <TAG in batch file at which to begin processing, six characters or less>
	 CMERRX <Invalid TAG>
	CALL SIX		;GET SIXBIT OF TAG
	 ERROR <TAG too long>
	MOVEI A,TAG2
	CALLRET STOR1

TAG2:	MOVEM B,.FPFST(Q1)
	RET

.COPIE:	DECX <Decimal number of copies to print>
	 CMERRX
	VERIFY B,C,FP.FCY	;VERIFY RANGE
	 ERROR <Invalid number of copies requested>
	MOVEI A,COP2	;IDENTIFY DATA TYPE
	CALL STOR1	;SAVE ARG
	RET		;DON'T REALLY STORE IT UNTIL PASS 2

COP2:	VERIFY B,.FPINF(Q1),FP.FCY
	 ERROR <Invalid number of copies requested>
	RET

;PAPER STYLE

.PF:	KEYWD $PF
	 0		;NO DEFAULT
	 CMERRX <Invalid paper format>
	MOVE B,P3
	MOVEI A,PF2
	CALLRET STOR1

PF2:	QSTOR B,.FPINF(Q1),FP.FPF
	RET

$pf:	TABLE
	T ARROW,,%FPLAR	;PRINT CONTROLS AS UPARROW LETTER
	T ASCII,,%FPLAS	;SEND FILE "AS IS"
	T OCTAL,,%FPLOC	;PRINT IN OCTAL
	T SUPPRESS,,%FPLSU	;SUPPRESS CONTROL CHARACTERS
	TEND

;FILE TYPE DESIRED

.FILE:	KEYWD $FTYPE	;SEE WHAT TYPE OF FILE SHE TYPES
	 0		;NO DEFAULT
	 CMERRX		;ERROR IF NONE TYPED
	MOVE B,P3
FFI1:	MOVEI A,FIL2
	CALL STOR1
	RET

;SPECIAL ENTRY FOR IMPLICIT /FILE:FORTRAN BECAUSE EXTENSION IS .DAT.

FORT:	MOVEI B,.FPFFO	;SPECIFY FORTRAN
	JRST FFI1

FIL2:	QSTOR B,.FPINF(Q1),FP.FFF
	RET

$FTYPE:	TABLE	;TABLE OF FILE TYPES
	T ASCII,,.FPFAS
	T COBOL,,.FPFCO
	T ELEVEN,,.FPF11
	T FORTRAN,,.FPFFO
	TEND

;HEADER TO PRINT HEADER ON FILE OUTPUT

.HEADE:	MOVEI A,HEA2
	MOVEI B,0
	CALL STOR1		;TURN OFF "NO HEADER" BIT
	RET

HEA2:	QSTOR B,.FPINF(Q1),FP.NFH
	RET

;NO HEADER WANTED

.NOHEA:	MOVEI A,NHEA2
	MOVEI B,1
	CALL STOR1		;TURN OFF "NO HEADER" BIT
	RET

NHEA2:	QSTOR B,.FPINF(Q1),FP.NFH
	RET

;REPORT CODE TO SEARCH FOR

.REPOR:	MOVEI B,[FLDDB. .CMQST,,,<Report code, up to twelve characters,>,,[
	flddb. .CMFLD]]	;REPORT CODE MAY OR MAY NOT BE IN QUOTES
	CALL FIELD	;READ IN THE REPORT FIELD
	TXNE A,CM%NOP	;MAKE SURE IT PARSED CORRECTLY
	 CMERRX <Invalid report string>
	MOVE A,[440700,,ATMBUF]	;PREPARE TO CHANGE REPORT TO SIXBIT
	MOVE B,[440600,,Q2]
	SETZB Q2,Q3
REP1:	call cackle		;GET CHARACTER FROM REPORT
	 JRST REP3	;NO MORE CHARACTERS
	CAMN B,[000600,,Q3]
	ERROR <Report string too long>
	IDPB C,B	;STORE CHARACTER OF REPORT STRING
	JRST REP1	;GO BACK FOR MORE

REP3:	MOVEI A,REP2	;ADDRESS FOR PASS2
	DMOVE B,Q2	;GET THE SIXBIT NAME
	CALL STOR1
	RET

REP2:	DMOVEM B,.FPFR1(Q1)	;STORE REPORT CODE
	RET

;DELETE FILE AFTER PRINTING

.DELET:	MOVEI B,1	;SET FLAG
DEL1:	MOVEI A,DEL2
	CALLRET STOR1

;PRESERVE FILE (DON'T DELETE IT AFTER PRINTING)

.PRESE:	MOVEI B,0
	CALLRET DEL1

DEL2:	QSTOR B,.FPINF(Q1),FP.DEL
	RET

;SPACING BETWEEN LINES

.SPACI:	KEYWD $SPACE		;GET SPACING PARAMETER
	 0		;NO DEFAULT
	 CMERRX		;BAD TYPEIN
	MOVE B,P3
	MOVEI A,SPA2
	CALLRET STOR1

SPA2:	QSTOR B,.FPINF(Q1),FP.FSP
	RET

$SPACE:	TABLE
	T DOUBLE,,2
	T SINGLE,,1
	T TRIPLE,,3
	TEND

;PROCESS REQUEST /AFTER: A CERTAIN TIME

.AFTER:	call gaft		;get after value
	MOVEI A,AFT2
	CALLRET STOR1

AFT2:	MOVEM B,.EQAFT(P1)	;STORE SPECIFIED TIME AND DATE
	RET

gaft:	dtx <Date and/or time after which to process request>
	 CMERRX <Invalid /AFTER value>
	RET


;PAPER TYPE SPECIFICATION

.FORMS:	CALL GFORMS		;GET FORMS WORD INTO B
	VERIFY B,C,EQ.FRM	;MAKE SURE IT FITS
	ERROR <Invalid FORMS specification>
	MOVEI A,FOR2
	CALLRET STOR1

FOR2:	QSTOR B,.EQLM1(P1),EQ.FRM	;MAKE SURE IT FITS
	RET

GFORMS:	WORDX <Type of paper to use for printing, six characters or less>
	 CMERRX <Invalid paper type>
	MOVE A,[440700,,ATMBUF]	;POINTER TO READ ASCII WORD
	MOVE B,[440600,,D]	;WE'LL FORM SIXBIT WORD IN D
	MOVEI D,0		;START WITH CLEAR WORD
FORM1:	call cackle		;GET CHARACTER
	 JRST FORM2		;DONE
	TLNN B,770000		;MAKE SURE ROOM FOR ANOTHER CHARACTER
	ERROR <FORMS specification too long>
	IDPB C,B		;STORE THE SIXBIT CHARACTER
	JRST FORM1		;GO DO REST OF CHARACTERS
FORM2:	MOVE B,D		;RETURN VALUE IN "B"
	RET

;SPECIFY NON-DEFAULT JOBNAME

.GOBNA:	CALL GJOB		;GET JOBNAME
	MOVEI A,JOB2
	CALLRET STOR1

JOB2:	TLO Z,F2		;MARK THAT SPECIFIC JOBNAME HAS BEEN GIVEN
	MOVEM B,.EQJOB(P1)	;STORE IT
	RET

;read sixbit jobname into b and mask into c...

GJOB:	WORDX <Name of request, six characters or less>
	 CMERRX <Invalid JOBNAME>
	CALL SIX		;GET SIXBIT VALUE FOR JOBNAME
	 ERROR <JOBNAME too long>
	HRROI C,-1		;FIRST ASSUME SPECIFIC NAME GIVEN
	CAMN B,[SIXBIT /*/]	;BUT IF "*" GIVEN,
	MOVEI C,0		;THEN ALLOW ANY JOBNAME TO MATCH
	RET

;ROUTINE TO RETURN SIXBIT OF ATOM BUFFER IN B.  SKIPS IFF NAME NOT TOO
;LONG

SIX:	MOVE A,[440700,,ATMBUF]	;POINTER TO READ ASCII WORD
	MOVE B,[440600,,D]	;POINTER TO SIXBIT AREA
	movei d,0		;start with clear word
JOBN1:	call cackle		;GET CHARACTER
	 JRST JOBN2		;NO MORE CHARACTERS
	TLNN B,770000		;MAKE SURE ROOM FOR ANOTHER CHARACTER
	 RET			;WORD TOO LONG
	IDPB C,B		;STORE THE SIXBIT CHARACTER
	JRST JOBN1		;GO DO REST OF CHARACTERS
JOBN2:	MOVE B,D		;RETURN SIXBIT IN B
	RETSKP

;LIMIT OF NUMBER OF PAGES TO PRINT

.LIMIT:	CALL GLIM		;GET LIMIT VALUE
	MOVEI A,LIM2
	CALLRET STOR1

LIM2:	QSTOR B,.EQLM2(P1),EQ.PGS	;STORE AND CHECK VALUE
	RET

GLIM:	DECX <Decimal number of pages, cards, or feet to limit request to>
	 CMERRX <Invalid /LIMIT value>
	VERIFY B,C,EQ.PGS	;CHECK VALUE
	ERROR <LIMIT out of range>
	VERIFY B,C,EQ.PTP	;CHECK VALUE
	ERROR <LIMIT out of range>
	VERIFY B,C,EQ.CDP	;CHECK VALUE
	ERROR <LIMIT out of range>
	RET

;FORCE PRINT REQUEST TO AN UPPER-LOWER PRINTER (ONE WHICH CAN PRINT LOWERCASE)

.UPPER:	SKIPA B,[SIXBIT /LU/]
.LOWER:	MOVE B,[SIXBIT /LL/]
	MOVEI A,LOW2
	CALLRET STOR1

LOW2:	MOVEM B,.EQRDV(P1)
	RET

;NOTE FOR HEADER PAGE

.NOTE:	CALL GNOTE
	MOVEI A,NOT2
	CALLRET STOR1

NOT2:	DMOVEM B,.EQLM3(P1)
	RET

GNOTE:	MOVEI B,[FLDDB. .CMQST,,,<Note for header page, up to twelve characters,>,,[
	flddb. .CMFLD]]	;NOTE MAY OR MAY NOT BE IN QUOTES
	CALL FIELD	;READ IN THE NOTE
	TXNE A,CM%NOP	;MAKE SURE IT PARSED CORRECTLY
	 CMERRX <Invalid NOTE>
	MOVE A,[440700,,ATMBUF]	;PREPARE TO CHANGE NOTE TO SIXBIT
	MOVE B,[440600,,Q2]
	setzb q2,q3	;start with clear note
NOTE1:	call cackle		;GET CHARACTER FROM NOTE
	 JRST NOTE3	;NO MORE CHARACTERS
	CAMN B,[000600,,Q3]
	ERROR <NOTE too long>
	IDPB C,B	;STORE CHARACTER OF NOTE
	JRST NOTE1	;GO BACK FOR MORE

NOTE3:	DMOVE B,Q2		;RETURN NOTE IN B AND C
	RET

REPEAT 0,<
;SPECIFICATION OF PARTICULAR PRINTER TO USE FOR PRINTING REQUEST

.PRINT:	WORDX <Name of printer, six characters or less>
	 CMERRX <Invalid printer name>
	MOVE A,[440700,,ATMBUF]	;POINTER TO READ ASCII WORD
	MOVE B,[440600,,Q2]	;POINTER TO PRINTER NAME AREA
	MOVEI Q2,0
PRYN1:	call cackle		;GET CHARACTER
	 JRST PRYN2		;NO MORE CHARACTERS
	TLNN B,770000		;MAKE SURE ROOM FOR ANOTHER CHARACTER
	ERROR <Printer name too long>
	IDPB C,B		;STORE THE SIXBIT CHARACTER
	JRST PRYN1		;GO DO REST OF CHARACTERS
PRYN2:	MOV