From:	CSBVAX::CSBVAX::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 10-FEB-1989 07:24
To:	MRGATE::"ARISIA::EVERHART"
Subj:	VMS_SHARE (Version 6.10) 1/4


Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Thu,  9 FEB 89 11:50:46 PDT
Received: from CUNYVM.CUNY.EDU by KL.SRI.COM with TCP; Thu, 9 Feb 89 11:44:12 PST
Received: from UKACRL.BITNET by CUNYVM.CUNY.EDU (IBM VM SMTP R1.1) with BSMTP id 8662; Thu, 09 Feb 89 14:16:39 EST
Received: from RL.IB by UKACRL.BITNET (Mailer X1.25) with BSMTP id 5889; Wed,
 08 Feb 89 13:37:03 GMT
Received: from RL.IB by UK.AC.RL.IB (Mailer X1.25) with BSMTP id 5752; Wed, 08
          Feb 89 13:37:02 GM
Via:      UK.AC.KCL.CC.OAK;  8 FEB 89 13:36:44 GMT
Date:     8-FEB-1989 13:36:20 GMT
From:     UDAA055%OAK.CC.KCL.AC.UK@CUNYVM.CUNY.EDU
To:       info-vax@KL.SRI.COM
Subject:  VMS_SHARE (Version 6.10) 1/4
Sender:   JANET "UDAA055@UK.AC.KCL.CC.OAK" <UDAA055%OAK.CC.KCL.AC.UK@CUNYVM.CUNY.EDU>
Mailer:   Janet_Mailshr V3.3 (14-Dec-1988)

$! ................... Cut between dotted lines and save. ...................
$!...........................................................................
$! VAX/VMS archive file created by VMS_SHARE V06.10 7-FEB-1989.
$!
$! VMS_SHARE was written by James Gray (Gray:OSBUSouth@Xerox.COM) from
$! VMS_SHAR by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au).
$!
$! To unpack, simply save, concatinate all parts into one file and
$! execute (@) that file.
$!
$! This archive was created by user UDAA055
$! on  8-FEB-1989 13:16:00.73.
$!
$! ATTENTION: To keep each article below 31 blocks (15872 bytes), this
$!            program has been transmitted in 4 parts.  You should
$!            concatenate ALL parts to ONE file and execute (@) that file.
$!
$! It contains the following 6 files:
$!        PAKMAIL.COM
$!        PAKMAIL.HLP
$!        TEST.TXT
$!        VMS_SHARE.COM
$!        VMS_SHARE.HLP
$!        VMS_SHARE.RELEASE_NOTES
$!
$!============================================================================
$ SET SYMBOL/SCOPE=( NOLOCAL, NOGLOBAL )
$ VERSION = F$GETSYI( "VERSION" )
$ IF VERSION .GES "V4.4" THEN GOTO VERSION_OK
$ WRITE SYS$OUTPUT "You are running VMS ''VERSION'; ", -
    "VMS_SHARE V06.10 7-FEB-1989 requires VMS V4.4 or higher."
$ EXIT 44 ! SS$_ABORT
$VERSION_OK:
$ GOTO START
$!
$UNPACK_FILE:
$ WRITE SYS$OUTPUT "Creating ''FILE_IS'"
$ DEFINE/USER_MODE SYS$OUTPUT NL:
$ EDIT/TPU/COMMAND=SYS$INPUT/NODISPLAY/OUTPUT='FILE_IS'/NOSECTION -
    VMS_SHARE_DUMMY.DUMMY
b_part := CREATE_BUFFER( "$Part", GET_INFO( COMMAND_LINE, "file_name" ) )
; s_file_spec := GET_INFO( COMMAND_LINE, "output_file" ); SET( OUTPUT_FILE
, b_part, s_file_spec ); b_errors := CREATE_BUFFER( "$Errors" ); i_errors
:= 0; pat_beg_1 := ANCHOR & "-+-+-+ Beginning"; pat_beg_2 := LINE_BEGIN
& "+-+-+-+ Beginning"; pat_end := ANCHOR & "+-+-+-+-+ End"; POSITION
( BEGINNING_OF( b_part ) ); LOOP EXITIF SEARCH( SPAN( ' ' )@r_trail
& LINE_END, FORWARD) = 0; POSITION( r_trail ); ERASE( r_trail ); ENDLOOP
; POSITION( BEGINNING_OF( b_part ) ); i_append_line := 0; LOOP EXITIF MARK
( NONE ) = END_OF( b_part ); s_x := ERASE_CHARACTER( 1 )
; IF s_x = '+' THEN r_skip := SEARCH( pat_beg_1, FORWARD, EXACT ); IF r_skip
<> 0 THEN s_x := ''; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ERASE_LINE; ENDIF
; ENDIF; IF s_x = '-' THEN r_skip := SEARCH( pat_end, FORWARD, EXACT )
; IF r_skip <> 0 THEN s_x := ''; MOVE_HORIZONTAL( -CURRENT_OFFSET ); m_skip
:= MARK( NONE ); r_skip := SEARCH( pat_beg_2, FORWARD, EXACT ); IF r_skip
<> 0 THEN POSITION( END_OF( r_skip ) ); MOVE_HORIZONTAL( -CURRENT_OFFSET )
; MOVE_VERTICAL( 1 ); MOVE_HORIZONTAL( -1 ); ELSE POSITION( END_OF( b_part
) ); ENDIF; ERASE( CREATE_RANGE( m_skip, MARK( NONE ), NONE ) ); ENDIF; ENDIF
; IF s_x = 'V' THEN s_x := ''; IF i_append_line <> 0 THEN APPEND_LINE
; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ENDIF; i_append_line := 1
; MOVE_VERTICAL( 1 ); ENDIF; IF s_x = 'X' THEN s_x := ''; IF i_append_line
<> 0 THEN APPEND_LINE; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ENDIF
; i_append_line := 0; MOVE_VERTICAL( 1 ); ENDIF; IF s_x <> '' THEN i_errors
:= i_errors + 1; s_text := CURRENT_LINE; POSITION( b_errors ); COPY_TEXT
( "The following line could not be unpacked properly:" ); SPLIT_LINE
; COPY_TEXT( s_x ); COPY_TEXT( s_text ); POSITION( b_part ); MOVE_VERTICAL
( 1 ); ENDIF; ENDLOOP; POSITION( BEGINNING_OF( b_part ) ); LOOP r_x := SEARCH
( "`", FORWARD, EXACT ); EXITIF r_x = 0; POSITION( r_x ); ERASE_CHARACTER
( 1 ); COPY_TEXT( ASCII( INT( ERASE_CHARACTER( 3 ) ) ) ); ENDLOOP
; IF i_errors = 0 THEN SET( NO_WRITE, b_errors, ON ); ELSE POSITION
( BEGINNING_OF( b_errors ) ); COPY_TEXT( FAO
( "The following !UL errors were detected while unpacking !AS", i_errors
, s_file_spec ) ); SPLIT_LINE; SET( OUTPUT_FILE, b_errors, "SYS$COMMAND" )
; ENDIF; EXIT;
$ DELETE VMS_SHARE_DUMMY.DUMMY;*
$ CHECKSUM 'FILE_IS
$ WRITE SYS$OUTPUT " CHECKSUM ", -
  F$ELEMENT( CHECKSUM_IS .EQ. CHECKSUM$CHECKSUM, ",", "failed!!,passed." )
$ RETURN
$!
$START:
$ FILE_IS = "PAKMAIL.COM"
$ CHECKSUM_IS = 1652512517
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X$! Purpose:
X$!`009To mail out a series of files produced by VMS_SHARE to a series
X$!`009of recipients.
X$!
X$! Parameters:
X$!
V$!`009P1 = name (or list ) of recipient(s). Can be logical or distribution li
Xst
X$!
X$!`009`009If sending to a distribution list, it is necessary to define
X$!`009`009a logical pointing to the file and then give thatlogical as
X$!`009`009the recipient name.  This avoids problems with DCL's handling
X$!`009`009of quotes and '@' symbols.
X$!
X$!
X$!`009P2 = file spec of package - "[directory]file" without VMS_SHARE suffix!
X$!
X$!`009`009Note that, if the filetype is not specified, the trailing dot
X$!`009`009must still be specified or the VMS_SHARE suffix is added to
X$!`009`009the FILENAME rather than to the TYPE.
X$!
X$!
X$!`009P3 = no of parts of the package
X$
X$! `009`009This procedure adds the VMS_SHARE suffix and sends files
X$!`009`009called  "[directory]file''nn'_OF_''P3'"   nn from 1-> 'P3'
X$
X$!`009P4 = Comment to add to mail subject line
X$
X$
X$! Privileges:
X$!`009Whatever is necessary to access e-mail and the relevant network.
X$!
X$!
X$! Environment:
X$!`009Nothing special.  VMS_SHARE must exist of course in order to
X$!`009produce the software package.
X$!
X$! Revision History:
X$!`0091.0`009Andy Harper`0096-DEC-1988`009Original version
X$!`0091.1`009Andy Harper`00919-DEC-1988`009Allow P4 to be mail subject
X$!`0091.2`009Andy Harper`0095-JAN-1989`009Return exit status
X$!
X$!
X$
X$
X$! SET UP STANDARD EXIT CODES
X$ ss$_normal= 1
X$ ss$_abort = 44
X$
X$
X$! MAKE SURE WE HAVE ALL THE PARAMETERS
X$ if P1 .nes. "" then $ goto end_get_recipient
X$get_recipient:
X$ inquire P1 "_mail address of recipient "
X$ if P1 .eqs. "" then $ goto get_recipient
X$end_get_recipient:
X$
X$ if P2 .nes. "" then $ goto end_package_location
X$package_location:
X$ inquire P2 "_Enter package directory and base filename "
X$ if P2 .eqs. "" then $ goto package_location
X$end_package_location:
X$
X$ if P3 .nes. "" then $ goto end_get_parts
X$get_parts:
X$ inquire P3 "_Enter number of parts "
X$ if P3 .eqs. "" then $ goto get_parts
X$end_get_parts:
X$
X$
X$! WHAT DO WE CALL OURSELVES ON THIS SITE? (FOR ERROR MESSAGES!)
X$ ident = f$parse(f$environment("PROCEDURE"),,,"NAME")
X$
X$! WE NEED THE PACKAGE NAME FOR THE SUBJECT HEADING
X$ package = f$parse(P2,,,"NAME")
X$
X$! WE NEED THE LENGTH OF THE MAXIMUM PART NUMBER, FOR FORMATTING PURPOSES
X$ l = f$length(P3)
X$
X$
X$! IS THERE A SET OF FILES THAT MATCHES THE SPECIFICATION??
X$ if f$search("''P2'"+"*_OF_"+"''P3'") .eqs. "" then $ goto nopackage
X$
X$
X$! DO A QUICK CHECK TO MAKE SURE ALL REQUIRED FILES ARE THERE!!!!!
X$ n = 0
X$ OK = "TRUE"
X$check:
X$   n = n+1
X$   if n .gt. P3 then $ goto end_check
X$   part = f$fao("!#ZL",l,n)
X$   if f$search(P2+part+"_OF_"+P3) .nes. "" then $ goto check
V$   write sys$error "%''ident'-E-NOPART, Part ''part' of ''package' is missin
Xg!"
X$   OK = "FALSE"
X$   goto check
X$end_check:
X$
X$
X$! WERE ALL THE PARTS FOUND? IF NOT, NOW'S THE TIME TO FIND OUT!
X$ if .not. OK then $ goto abandon
X$
X$
X$! LOOP AROUND EACH PART AND SEND
X$ n = 0
X$loop:
X$   n = n+1
X$   if n .gt. P3 then $ exit ss$_normal
X$   part = f$fao("!#ZL",l,n)
V$   write sys$output "%''ident-I-SENDPART, sending part ", part, " of ", pack
Xage
V$   mail/noedit/noself/subject="''package' ''P4' ''part'/''P3'" 'p2''part'_OF
X_'P3' 'P1'
X$   if $status then $ goto loop
X$   exit $status`009! Return status from mail if it failed
X$
X$
X$nopackage:
V$  write sys$error "%''ident'-E-NOPACKAGE, Cant find any files for ''package'
X."
X$abandon:
V$  write sys$error "%''ident'-E-ABANDON, One or more missing parts. Send aban
Xdoned."
X$  exit ss$_abort
$ GOSUB UNPACK_FILE

$ FILE_IS = "PAKMAIL.HLP"
$ CHECKSUM_IS = 67466936
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X1 PAKMAIL
XSends a series of files produced by VMS_SHARE across the E-mail
Xsystem to a specified set of recipients.`032
X
XFormat:
X     $ PAKMAIL recipient filespec parts [comment]
X2 Examples
X     $ PAKMAIL FRED [.TEST]PACKAGE. 25
X          Send all 25 parts of a VMS_SHARE created series of files
X          that comprise the package "PACKAGE". Files have a generic
X          prefix of "[.TEST]PACKAGE." (note the trailing period!) and
X          each will have its TYPE be suffixed by the VMS_SHARE
X          convention of 'nn_OF_25'.
X2 Filespec
XThe directory and fixed constant part of the files containing the
XVMS_SHARE'd package. For a null file type, the trailing period`032
XMUST be specified.
X
XFor instance, the name "[.TEST]BURBLE.SHAR" refers to the files:
X
X     [.TEST]BURBLE.SHARnn_OF_mm
X
X'nn' and 'mm' having their usual VMS_SHARE meanings. The actual
Xvalues of nn and mm are incorporated automatically as the files
Xare sent.`032
X2 Comment
XSpecifies an optional comment string to be inserted into the MAIL
X/SUBJECT header line, between the package name and the number of the`032
Xpart.
X
XFor example, without this parameter, the /SUBJECT line looks like this:`032
X   Subject:   VMS_SHARE  1/4
X
XWith this parameter set to the string "(Version 6 Pre-release)", the`032
X/SUBJECT line looks like this:
X   Subject:   VMS_SHARE (Version 6 Pre-Release) 1/4
X2 Parts
XSpecifies the number of parts making up the complete package to`032
Xbe sent. This defines not only the total number of files to be`032
Xsent but also the format of the filenames (which are suffixed by`032
X'nn_OF_mm', where 'mm' is the number of parts).
X
XThis is the format in which VMS_SHARE generates the files.
X
XThere is no default for this.
X2 Recipient
XThe mail address of the recipient. Anything acceptable to MAIL
Xmay be specified with two caveats.  Use of the '@' sign for
Xdistribution lists, and use of quotes around any part of the mail
Xaddress.`032
X3 Distribution_Lists
XUse of distribution lists directly does not work as DCL gets at
Xthe '@' symbol before MAIL does!  It must be done by pointing a
Xlogical name at the distribution list, including the '@' and then
Xusing the logical name as the recipient.`032
X
XFor instance, to simulate:
X
X   $ PAKMAIL @FRIENDS   ....
X
XDo:
X
X   $ DEFINE FRIENDS "@FRIENDS.DIS"
X   $ CREATE FRIENDS.DIS
X   ..... insert friends here
X   `094Z
X   $ PAKMAIL FRIENDS .....
X3 Network_names
XSpecifying network address usually requires the use of quotes.
XAgain, with this utility DCL gets at them before MAIL does so it
Xis necessary to double up the quotes if specifying them directly
Xon the command line. First double the quotes and then add one
Xextra set around the lot:`032
X
XFor instance, to simulate:
X
X   $ PAKMAIL  EARN%"FRED@CARNEGIE"
X
XDo:
X   $ PAKMAIL  EARN%"""FRED@CARNEGIE"""
X
XAlternatively, define a logical name that contains the original
Xform of address:`032
X
X   $ DEFINE BROTHER EARN%"""FRED@CARNEGIE"""
X   $ PAKMAIL BROTHER   ...
X2 VMS_SHARE
VVMS_SHARE packages a series of files into the special format. See the help on
X`032
Xthat utility for specific information.
$ GOSUB UNPACK_FILE

$ FILE_IS = "TEST.TXT"
$ CHECKSUM_IS = 1650208991
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X---------------------------------------- Test printable characters
Xabcdefghijklmnopqrstuvwxyz`009! All lower case letter, in order
XABCDEFGHIJKLMNOPQRSTUVWXYZ`009! All upper case letters, in order
X0123456789`009`009`009! All digits in order
X`096  ! Backwords quote
X`126  ! Tilde
X!  ! Exclamation mark
X@  ! at sign
X#  ! Hash or pound sign
X$  ! Dollar sign
X%  ! Percent sign
X`094  ! Caret
X&  ! Ampersand
X*  ! asterisk
X(  ! Left round bracket
X)  ! Right round bracket
X-  ! minus
X+  ! plus
X=  ! equals
X`123  ! left brace
X`125  ! right brace
X[  ! left square bracket
X]  ! right square bracket
X:  ! colon
X"  ! Double quote
X`124  ! vertical bar
X;  ! semicolon
X'  ! single quote
X\  ! backslash
X>  ! greater than
X<  ! less than
X,  ! comma
X.  ! period
X?  ! question mark
X/  ! slash
X---------------------------------------- Test single blank line
X
V---------------------------------------- Test trailing blanks, non split line
Xs
XHere are some lines with trailing blanks      `032
Xand another    `032
X---------------------------------------- Test trailing blanks, split lines
V12345678901234567890123456789012345678901234567890123456789012345678901234567
X8901234567890123456789012345678901234567890123456789012345678901234567890
V1234567890    x     x     x     x     x     x     x     x     x     x     x
X     x     x    `032
V1234567890   x     x     x     x     x     x     x     x     x     x     x
X     x     x    `032
V1234567890  x     x     x     x     x     x     x     x     x     x     x`032
X    x     x      `032
V1234567890 x     x     x     x     x     x     x     x     x     x     x `032
X   x     x     `032
V1234567890x     x     x     x     x     x     x     x     x     x     x     x
X     x     `032
$ GOSUB UNPACK_FILE

$ FILE_IS = "VMS_SHARE.COM"
$ CHECKSUM_IS = 1364737892
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
V$ verify = 'f$verify(f$trnlnm("SHARE_VERIFY"))'`009! Set to 1 if verify requi
Xred
X$ display= f$trnlnm("SHARE_DISPLAY")`009`009! Set to 1 to display TPU errs
V$ max_part_size = f$integer(f$trnlnm("share_max_part_size"))! Allow the user
X to override
X$
X$ FACILITY_NAME = "VMS_SHARE"
X$ FACILITY_VERSION = "V06.10 7-FEB-1989"
X$!
X$ SS$_ABORT=44
X$ SET = "SET"
X$ SET SYMBOL/SCOPE=( NOLOCAL, NOGLOBAL )
X$ ON CONTROL_Y THEN EXIT SS$_ABORT
X$ ON ERROR THEN CONTINUE
X$!++---------------------------------------------------------------------
X$! VMS_SHARE was written by James Gray.
X$!
X$! James Gray`009`009`009`009Gray:OSBUSouth@Xerox.COM
X$! Independent Consultant
X$! 875 Victor Avenue, #102
X$! Inglewood, CA  90302
X$! Phone: (213) 412-5086
X$!
X$!++---------------------------------------------------------------------
X$! Substantial rewrites and enhancements by Andy Harper
X$!    o deal with trailing blanks
X$!    o simplify code
X$!    o speed up packing/unpacking algorithms
X$!
X$! Andy Harper,
X$! Computing Centre,
X$! Kings College London
X$! The Strand,
X$! London
X$! Phone +44 (0)1 836 5454
X$! E-MAIL:  UDAA055 @ OAK.CC.KCL.AC.UK    (UK JANET academic network)
X$!
X$!++---------------------------------------------------------------------
X$! Substantial credit is given to Michael Bednarek who wrote the original
X$! VMS_SHAR.
X$!
V$! Michael Bednarek              u3369429@`123murdu.oz.au `124 ucsvc.dn.mu.oz
X.au`125
X$! Institute of Applied Economic -- or --
V$!  and Social Research (IAESR) ...`123UUNET.UU.NET `124 seismo.CSS.GOV`125!m
Xunnari!
V$! Melbourne University          `123murdu.oz `124 ucsvc.dn.mu.oz`125!u336942
X9
X$! Parkville 3052, Phone : +61 3 344 5744
X$! AUSTRALIA
X$!
X$! The following copyright notice is being left intact since it is unclear
X$! whether this extensive rewrite constitutes a new work or is simply a
X$! derivation of the original.  Just in case this constitutes a new work,
X$! a second copyright notice is included below; in case of conflict on
X$! copyrights, the copyright is granted to Michael Bednarek.
X$!
-+-+-+-+-+ End of part 1 +-+-+-+-+-

