[comp.os.vms] Sending data from DCL to terminal lines without carriage control

oberman@LLL-ICDC.ARPA ("Oberman, Kevin") (05/22/87)

I have received several questions about how to use the READ/PROMPT DCL command
to send a string to a terminal line with no carriage control. Following is an
example of the required code. This code will dial a Racal-Vadic 2400V Maxwell
modem. N.B. If you want to use it for that purpose, the modem must be preset to
O111122112. I realize you probably don't have a Maxwell, but if you do, I don't
need to cause you more problems.

The code was not intended for general use, so its rather messy. Sorry.

This file contains control characters which the gateway would probably filter
out, so replace the <special> strings whith the real thing. You can use
the EDT SPECIAL INSERT command or the EVE QUOTE command.

$!	A command file designed to have the computer
$!	call out to any number (P1).  Use terminal line (P2) or ask.
$!
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$
$ if f$mode() .eqs. "BATCH" then purge/log dial.log
$ if f$mode() .eqs. "BATCH" then rename/log dial.log; dial.log;1
$	set NOon
$
$ if "''P1'" .eqs. "" then Read/Prompt="Number? " sys$command P1
$ if "''p2'" .eqs. "" then Read/Prompt="Line? " sys$command P2
$ Dialer = P2 - ":" + ":"
$	ctrl_e == "<ctrl-e><cr>" !Modem wake up sequence
$	Phone_number="D''P1'<cr>"!Modem dial command
$	SETUP = "O111122112<cr>" !Modem command to set up the right options
$
$	wait 0:0:10
$	   try_cnt = 0
$	open/write Phone_line 'Dialer' !The terminal must be opened to talk to it.
$	set term/speed=2400/passall/noecho/nohang 'Dialer' !Use 2400 baud
$ !	Clear out any junk from the line
$5$:	   read/prompt=""/time=2/error=10$ Phone_line response
$	   sho sym response !Just so the log shows what is happening
$	   goto 5$
$10$: ! Wake up the modem
$	   read/time=30/error=error_vector/prompt="''ctrl_e'" Phone_line response
$	   sho sym response
$	   If f$length(response) .eq. 2 then goto DIAL !Should be H<LF>
$ ! Long response indicates the line is not set up
$	   read/prompt=""/error=error_vector/time=5 Phone_line response
$	   wait 0:0:1
$	   sho sym response
$!	   read/prompt="SETUP"/error=error_vector/time=5 Phone_line response
$ 	   write Phone_line "O111122112"
$	   sho sym response
$DIAL: !Dial the modem
$	   read/prompt="''Phone_number'"/time=30 Phone_line response
$	   sho sym response
$	   If f$length(response) .gt. 2 then goto read_loop
$	   If response .eqs. "H<LF>" then goto error_vector
$	   If response .eqs. "1<LF>" then goto GOT_IT
$	   If response .eqs. "2<LF>" then goto GOT_IT
$	   If response .eqs. "3<LF>" then goto GOT_IT
$	   Goto READ_LOOP
$READ_LOOP:
$	   read/prompt=""/error=loop/time=30 Phone_line response
$	   sho sym response
$	   If f$length(response) .gt. 2 then goto read_loop
$	   If response .eqs. "<LF>" then goto read_loop	! Nothing
$	   If response .eqs. ".<LF>" then goto read_loop! OK
$	   If response .eqs. "D<LF>" then goto read_loop! Dialing
$	   If response .eqs. "1<LF>" then goto GOT_IT	! Online at 300
$	   If response .eqs. "2<LF>" then goto GOT_IT	! Online at 1200
$	   If response .eqs. "3<LF>" then goto GOT_IT	! Online at 2400
$	   If response .eqs. "A<LF>" then goto read_loop! Call answered
$	   If response .eqs. "R<LF>" then goto read_loop! Phone ringing
$	   goto error_vector
$
$error_vector:
$ show symbol response
$	write phone_line "I" !Turn off the modem; it's not going to work
$
$GOT_IT:
$	set ter/sp=9600 'Dialer' !Reset line speed to allow autobaud to work
$	close      Phone_line    !Good-bye
$
$return_vector:
$	EXIT

I hope this explains how to pull off the trick.

					R. Kevin Oberman
					Lawrence Livermore National Laboratory
					arpa: oberman@lll-icdc.arpa
					(415) 422-6955

Disclaimer: I an not endorsing any product. I work for Uncle Sam and to
do so would make him upset. I further take no resposibility for the accuracy
of this information. I believe it is correct, but if it's not I can only
say "Sorry".
------