From:	CSBVAX::MRGATE!nagy%warner.hepnet@LBL.Gov@SMTP 14-MAY-1988 18:39
To:	ARISIA::EVERHART
Subj:	Re: How do you allow printing on remote nodes?


Received: from LBL.Gov by KL.SRI.COM with TCP; Sat 7 May 88 06:47:44-PDT
Received: from warner.hepnet by LBL.Gov with VMSmail ;
	Sat, 7 May 88 06:46:36 PDT
Date:    Sat, 7 May 88 06:46:36 PDT
From:     nagy%warner.hepnet@LBL.Gov (Frank J. Nagy, VAX Wizard & Guru)
Message-Id: <880507064636.2080658e@LBL.Gov>
Subject: Re: How do you allow printing on remote nodes?
To:       Info-VAX@kl.sri.com
X-ST-Vmsmail-To: INFO_VAX

> I can not use PRINT/REMOTE because the Laser printer is not my
> default queue, furthermore it would not allow for /FORM qualifiers.
>...
> Questions:
> 1. Does anyone have solutions or workarounds to these problems?

We have been doing this for quite awhile with a pair of procedures I
wrote (and which are attached below).  The REMOTEPRINT.COM procedure
is used at the "client" end.  For instance, I have the FPZ12 symbol
defined as:

    FPZ12 :== @RDCS$COM:REMOTEPRINT  FNAL::WH12X_PRINT/SETUP=S814L

Using FPZ12 will print a file on the local laser printer in landscape
format.  The laser printer is connected to the FNAL VAXCluster and
I am running on the WARNER LAVC (the printer defaults to portrait mode).
I make this work by putting the second procedure, RMTPRINTER.COM, in
my login area on FNAL and by having proxy logins between my WARNER
and FNAL accounts (alternatively, RMTPRINTER can be declared as a
DECnet object for use by anyone - without proxy accounts).

These procedures work by having REMOTEPRINT open a DECnet channel to
object RMTPRINTER (in this case, RMTPRINTER.COM in my FNAL login area)
to pass the current default directory, source node, destination queue
name and queue parameters.  RMTPRINTER.COM then copies the files from
the source node and does the necessary PRINT command (with /DELETE
added).  The only thing not done at this time is to support the use
of the /DELETE qualifier on the REMOTPRINT.COM input so delete the
file on the source node.

Until we get DQS (see below) up and running, these procedures have
mostly solved our need to access the printers connected on another
system.

> 2. Has anyone heard of better or smarter SYMBIONTs under VMS 4.*
No.
> 3. Can we expect anything better in VMS 5.0
Probably not.
> 4. Is there any way to share my printer with other DECNET nodes
>    (Directly or through a terminal server), how would you do it?
>    what do you have to pay?

Yes, buy the DQS (Distributed Queuing Services) package.  This allows
client nodes to have print queues which feed print queues on server
nodes.  As I remember, a DQS license for a MicroVAX is on the order of
$400 or so.

= Frank J. Nagy   "VAX Guru & Wizard"
= Fermilab Research Division EED/Controls
= HEPNET: WARNER::NAGY (43198::NAGY) or FNAL::NAGY (43009::NAGY)
= BitNet: NAGY@FNAL
= USnail: Fermilab POB 500 MS/220 Batavia, IL 60510

........................ Cut between dotted lines and save ......................
$!..............................................................................
$! VAX/VMS archive file created by VMS_SHAR V-5.01 01-Oct-1987
$! which was written by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au)
$! To unpack, simply save and execute (@) this file.
$!
$! This archive was created by NAGY
$! on Saturday 7-MAY-1988 08:36:25.16
$!
$! It contains the following 2 files:
$! REMOTEPRINT.COM RMTPRINTER.COM
$!==============================================================================
$ Set Symbol/Scope=(NoLocal,NoGlobal)
$ Version=F$GetSYI("VERSION") ! See what VMS version we have here:
$ If Version.ges."V4.4" then goto Version_OK
$ Write SYS$Output "Sorry, you are running VMS ",Version, -
                ", but this procedure requires V4.4 or higher."
$ Exit 44
$Version_OK: CR[0,8]=13
$ Pass_or_Failed="failed!,passed."
$ Goto Start
$Convert_File:
$ Read/Time_Out=0/Error=No_Error1/Prompt="creating ''File_is'" SYS$Command ddd
$No_Error1: Define/User_Mode SYS$Output NL:
$ Edit/TPU/NoSection/NoDisplay/Command=SYS$Input/Output='File_is' -
        VMS_SHAR_DUMMY.DUMMY
f:=Get_Info(Command_Line,"File_Name");b:=Create_Buffer("",f);
o:=Get_Info(Command_Line,"Output_File");Set(Output_File,b,o);
Position(Beginning_of(b));Loop x:=Erase_Character(1);Loop ExitIf x<>"V";
Move_Vertical(1);x:=Erase_Character(1);Append_Line;
Move_Horizontal(-Current_Offset);EndLoop;Move_Vertical(1);
ExitIf Mark(None)=End_of(b) EndLoop;Position(Beginning_of(b));Loop
x:=Search("`",Forward,Exact);ExitIf x=0;Position(x);Erase_Character(1);
If Current_Character='`' then Move_Horizontal(1);else
Copy_Text(ASCII(INT(Erase_Character(3))));EndIf;EndLoop;Exit;
$ Delete VMS_SHAR_DUMMY.DUMMY;*
$ Checksum 'File_is
$ Success=F$Element(Check_Sum_is.eq.CHECKSUM$CHECKSUM,",",Pass_or_Failed)+CR
$ Read/Time_Out=0/Error=No_Error2/Prompt=" CHECKSUM ''Success'" SYS$Command ddd
$No_Error2: Return
$Start:
$ File_is="REMOTEPRINT.COM"
$ Check_Sum_is=1697812554
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X$ verify = 'F$VERIFY(0)'
X$!.. REMOTEPRINT.COM`009`009Send print files to remote printers
X$!.. Description/history at end of file.
X$ ON CONTROL_Y THEN $ GOTO CLEAN_EXIT
X$GET_LIST:
X$ IF p2 .EQS. "" THEN $ INQUIRE  p2  "Files"
X$ IF p2 .EQS. "" THEN $ GOTO GET_LIST
X$ naq = F$ELEMENT( 0, "/", p1)`009`009!Ignore any qualifiers
X$ node = F$PARSE( naq,,, "NODE", "SYNTAX_ONLY")
X$ qname = F$PARSE( naq,,, "NAME", "SYNTAX_ONLY")
X$ qualifiers = ""
X$ p1 = F$ELEMENT( 1, "/", p1)`009`009!Get any "command" qualifiers
X$ IF p1 .NES. "/" THEN qualifiers = "/" + p1
X$ p1 = F$ELEMENT( 1, "/", p2)`009`009!Get any qualifiers after the file list
X$ IF p1 .NES. "/" THEN qualifiers = qualifiers + "/" + p1
X$ p2 = F$ELEMENT( 0, "/", p2)`009`009!Lose any qualifiers from file list
X$ first = 1
X$ files = ""
X$ last = ""
X$FILES_LOOP:`009`009`009`009!Scan file list
X$ file = F$ELEMENT( 0, ",", p2)`009`009!Get first file specification
X$ p2 = p2 - file`009`009`009!Just remainder of file list
X$ IF F$EXTRACT(0,1,p2) .EQS. "," THEN p2 = p2 - ","
X$ IF first .AND. F$ELEMENT( 1, ".", file) .EQS. "." THEN -
X$`009file = file + ".LIS"`009`009!Add default .LIS file type to 1st file
X$ first = 0
X$ last = F$PARSE( file, last)
X$ IF F$SEARCH( last) .EQS. "" THEN $ GOTO MISSING_FILE
X$ IF files .NES. "" THEN files = files + ","
X$ files = files + file
X$ IF p2 .NES. "" THEN $ GOTO FILES_LOOP
X$ locale = F$ENVIRONMENT( "DEFAULT")`009!Current default disk/directory
X$ OPEN /WRITE /ERROR=NODE_DOWN`009T2T`009'node'"TASK=RMTPRINTER"
X$ WRITE`009T2T`009locale
X$ WRITE`009T2T`009files
X$ WRITE`009T2T`009"/QUEUE=''qname' " + qualifiers
X$ CLOSE`009T2T
X$CLEAN_EXIT:
X$ EXIT`009F$VERIFY(verify).OR.1
X$MISSING_FILE:
X$ WRITE SYS$OUTPUT "%REMOTEPRINT-F-NOSUCHFILE, no files found '",file,"'"
X$ EXIT`009F$VERIFY(verify).OR.1
X$NODE_DOWN:
X$ WRITE SYS$OUTPUT "%REMOTEPRINT-F-NODE, ",node," down or no RMTPRINTER task"
X$ EXIT`009F$VERIFY(verify).OR.1
X$!=============================================================================
X$!+ REMOTEPRINT
V$! Print one or more files on remote printers.  Files (wildcards are acceptable
X)
X$! must be in current default directory.
X$!
X$!`009$ @REMOTEPRINT  node::queue [/qualifiers]  file[,...] [/qualifiers]
X$!
X$! The most useful qualifiers are /SETUP, /FEED, /HEADER and /FORM.  The file
X$! selection qualifiers (such as /BEFORE, etc.) should not be used, but in
X$! general any other PRINT command qualifier can be used.  If the file (or
X$! the first file in a list) specification does not include a file type,
X$! then a file type of ".LIS" will be appended to this file specification
X$! (to simulate the PRINT command).
X$!
X$! For instance, a print command defined to use the 13th floor Talaris-800
X$! for printing in "line printer" mode might look like:
X$!
X$!`009$ FPR*INT :== @REMOTEPRINT  FNAL::WH13W_PRINT/SETUP=S814L
X$!
X$! The REMOTEPRINT procedure will attempt to verify that the files exist
X$! before starting the network operations.  If at least one file is not
X$! found for each specification in the list (i.e. wildcards are tested for
X$! only a single match), then the error message "%REMOTEPRINT-F-NOSUCHFILE"
X$! will be displayed.
X$!-
X$!=============================================================================
X$! Modifications:
X$!  22-Aug-86`009FJN`009Created to use 13th floor Talaris-800 in S814L mode
X$!  27-Aug-86`009FJN`009Improved to check the list of files for "existance"
X$!`009`009`009using F$SEARCH and to add ".LIS" to first filename
X$!`009`009`009if no file type provided.
X$!  16-Feb-88`009FJN`009Fix error handling if remote node is down
$ GoSub Convert_File
$ File_is="RMTPRINTER.COM"
$ Check_Sum_is=790954627
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X$ verify = 'F$VERIFY(0)'
X$!.. RMTPRINTER.COM`009`009Remote end to receive remote printing requests
X$!.. Description/history at end of file.
X$ OPEN /READ`009T2T`009SYS$NET:
X$ READ`009T2T`009locale
X$ READ`009T2T`009filelist
X$ READ`009T2T`009printquals
X$ CLOSE`009T2T
X$ IF F$TRNLNM( "TMP$") .EQS. "" THEN $ DEFINE`009TMP$`009SYS$SCRATCH:
X$ SET DEFAULT`009SYS$REM_NODE::'locale'
X$ COPY`009`009'filelist'`009TMP$:
X$ files = ""
X$LOOP:
X$ file = F$ELEMENT( 0, ",", filelist)
X$ filelist = filelist - file
X$ IF F$ELEMENT( 1, ":", file) .NES. ":" THEN file = F$ELEMENT( 1, ":", file)
X$ IF F$ELEMENT( 1, "]", file) .NES. "]" THEN file = F$ELEMENT( 1, "]", file)
X$ IF files .NES. "" THEN files = files + ","
X$ files = files + file
X$ filelist = filelist - ","
X$ IF filelist .NES. "" THEN $ GOTO LOOP
X$ PRINT 'printquals' /DELETE`009TMP$:'files'
X$ EXIT`009F$VERIFY(verify).OR.1
X$!=============================================================================
X$!+ RMTPRINTER
X$! DECnet object to receive print request from a remote node.  Three records
X$! are transferred across the task-to-task link:
X$!`0091. Default remote system disk/directory
X$!`0092. File list (including wildcards)
X$!`0093. Qualifiers for print command
X$! The files are copied to the local system and then PRINT'ed.
X$!
X$! This file must be placed in your login area on the remote system (the one
X$! with the printers and print queues).  The files are copied into your
X$! temporary area (logical name TMP$:) and printed from there.  If you have
X$! not defined a temporary area, then your scratch area defined by the logical
X$! name SYS$SCRATCH: is used (by default this would be your login area).
X$! You can edit this file to direct the files to some other directory as
X$! you wish.  Note that the files are always printed /DELETE on the remote
X$! system (where this procedure resides) since they are only copies of the
X$! files still present on the originating system.
X$!
X$! NOTE: This require proxy logins to work!
X$!-
X$!=============================================================================
X$! Modifications:
X$!  22-Aug-86`009FJN`009Created to be FNAL end of FNALPRINT.COM procedure.
V$!  31-Dec-86`009FJN`009Use TMP$ for file holding area, if no TMP$ logical foun
Xd
X$!`009`009`009then define one for this process as SYS$SCRATCH:; also
X$!`009`009`009do SET DEFAULT then COPY to allow for files not in the
X$!`009`009`009default directory
V$!  02-Jan-87`009FJN`009Add loop to strip device/directory information from fil
Xe
X$!`009`009`009list for use on PRINT command
$ GoSub Convert_File
$ Exit
