From: CSBVAX::MRGATE!@KL.SRI.Com:carl@CitHex.Caltech.Edu@SMTP 29-JUN-1987 06:53 To: EVERHART Subj: Re: Operator queries from batch Received: from CitHex.Caltech.Edu by KL.SRI.COM with TCP; Sun 28 Jun 87 20:32:53-PDT Date: Sun, 28 Jun 87 05:20:22 PDT From: carl@CitHex.Caltech.Edu (Carl J Lydick) Message-Id: <870628042750.00a@CitHex.Caltech.Edu> Subject: Re: Operator queries from batch In-Reply-To: Your message <870625-081716-3410@Xerox> dated 25-Jun-1987 To: bkahl.rochX2@Xerox.COM, info-vax@CitHex.Caltech.Edu > This seems like a trivial question, but I can't find a satisfactory answer, > so maybe it isn't. How do you prompt the operator(console) and accept the > response from a batch job? It seems like there are times when this is > desirable (for tape information, e.g.) but I can't see a way to do it with > the standard commands. I take it that you want more than just a YES/NO response. The way to do this is to put something like the dcl script that follows into your procedure. This DCL is more complicated than you'll generally need, but in case you've got a wise-guy operator (having filled in for operators occasionally when they had to be away unexpectedly, I'm a living exmample that this can happen) who responds with something like: $ foo = f$fao("!AS!/!AS!/!AS", "This is the first of three records", - "This is the second of three records",- "This is the third of three records") $ reply/to=17 "''foo'" then the extra code can be useful. Hope this helps. $ set noon $ set NOverify $ REP_FILE = F$GETJPI("","PID")+".REPLY-FILE" $ IF F$SEARCH(REP_FILE) .NES. "" THEN DELETE 'REP_FILE';* $ DEFINE/USER SYS$OUTPUT 'REP_FILE' $ req/rep "REPLY with text. The batch job will read the reply" $! set verify $ OPEN/READ FILE 'REP_FILE' $ DELETE 'REP_FILE';* $ READ FILE RECORD $ READ FILE RECORD $ CLOSE FILE $ CRLF:= $ CRLF[0,16] = %X0A0D $ END := $ END[0,16] = %XFFFF $ RECORD = RECORD - ("%OPCOM-S-OPREPLY, " + CRLF) $ REPLY := $ LOOP: LEN = F$LOCATE(CRLF, RECORD) $ IF LEN .EQ. F$LENGTH(RECORD) THEN GOTO DONE $ TMP = F$EXTRACT(0, LEN + 2, RECORD) $ REPLY = REPLY + TMP $ RECORD = RECORD - TMP $ GOTO LOOP $ DONE: REPLY = (REPLY + END) - (CRLF + END) $ IF REPLY .nes. "" then WRITE/symbol SYS$OUTPUT REPLY