home *** CD-ROM | disk | FTP | other *** search
/ The Best of Windows 95.com 1996 September / WIN95_09961.iso / mailsrv / LSV95.ZIP / win95.z / listjob.memo < prev    next >
Text File  |  1995-05-24  |  22KB  |  441 lines

  1.              LISTSERV historical documentation, release 1.5b
  2.              -----------------------------------------------
  3.                        Copyright Eric Thomas 1986
  4.  
  5.  
  6.        ********************************************************
  7.        *                                                      *
  8.        *  A description of the Listserv Commands-Job feature  *
  9.        *                                                      *
  10.        ********************************************************
  11.  
  12.  
  13.  
  14. ****************
  15. * Introduction *
  16. ****************
  17.  
  18.     The "Commands-Job"  feature of  Revised Listserv  was designed  in an
  19.   attempt  to  allow for  powerful  inter-LISTSERV  (and more  generally,
  20.   program-to-LISTSERV) command transmission  with message redirection and
  21.   multi-line arguments capability, while still allowing unexpert users to
  22.   send commands to  LISTSERV for execution in a  very simple, "intuitive"
  23.   way.
  24.  
  25.     The implementation of Commands-Jobs has therefore been split into two
  26.   different layers: the 'core' command job language interpreter, with its
  27.   exacting,  powerful but  stern control  cards syntax,  and the  'outer'
  28.   interface to the user which provides the required default control cards
  29.   whenever they have  been omitted, translating an  "intuitive" series of
  30.   commands to execute  into an actual commands-job that  can be processed
  31.   by the 'core' interpreter.
  32.  
  33.     Since this  documentation is  primarily intended for  postmasters and
  34.   LISTSERV applications programmers,  it will be oriented  towards a des-
  35.   cription of the  'core' interpreter. The work of  the 'outer interface'
  36.   will only be mentioned for better understanding. The 'core' interpreter
  37.   will be referred to as 'Command Job Language Interpreter' (CJLI) in the
  38.   following discussion.
  39.  
  40.     Warning: if  you are  familiar with  MVS and  JCL, you  will probably
  41.   notice some similarity between command  job control cards and JCL. This
  42.   similarity is purposeful and was intended to make CJLI easier to under-
  43.   stand for JCL  adepts and to make MVS users  more comfortable with CJLI
  44.   (MVS users  who do not  have any mailing system  such as UCLA  mail and
  45.   have difficulties  sending/receiving messages  are often forced  to use
  46.   (basic)  CJLI control  cards to  send commands  to LISTSERV).  However,
  47.   there are a  number of differences between CJLI and  JCL and you should
  48.   not assume that a  given JCL card has the same  meaning and syntax than
  49.   its CJLI counterpart. Some JCL features which were deemed to be unneces
  50.   sary (eg  dataset concatenation  with a  blank DD  card) have  not been
  51.   implemented, and new features  have been implemented whenever required.
  52.  
  53.  
  54. ******************************
  55. * Overview -- the JOB entity *
  56. ******************************
  57.  
  58.     As  soon  as the  'outer'  interface  detects  that a  file  contains
  59.   commands (as opposed to a mail  or non-mail file intended for redistri-
  60.   bution to a list), it passes it  to the CJLI for execution. This physi-
  61.   cal  file will  contain one  or more  logical 'JOB's  with interspersed
  62.   comment lines.  Each 'JOB'  will contain zero  or more  commands, start
  63.   with a "// JOB"  card and end with a "// EOJ"  card. The 'outer' inter-
  64.   face will  provide these cards  if omitted,  but this will  be detailed
  65.   later  on. Anything  before the  first "//  JOB" card,  after the  last
  66.   "// EOJ" or  between "// EOJ" and  "// JOB" cards is  ignored. Notably,
  67.   mail headers  and "Acknowledge-To:" fields  (at the bottom of  the mail
  68.   file) would be  ignored. A physical job file containing  two jobs might
  69.   look like this:
  70.  
  71.  
  72. (any number of header lines, ignored)
  73.  //jobname1 JOB  options
  74.              .
  75.              .
  76.              .
  77.  //jobname1 EOJ
  78. (any number of lines, ignored)
  79.  //jobname2 JOB  options
  80.              .
  81.              .
  82.              .
  83.  //jobname2 EOJ
  84. (any number of lines before EOF, ignored)
  85.  
  86.  
  87.     Each  job in  the physical  file is  a completely  independent entity
  88.   which contains commands and the  'dataset' definitions required to exe-
  89.   cute the commands properly. Jobs are executed in sequential order; if a
  90.   job does not execute successfully, the  other jobs in the physical file
  91.   are still  executed, unless the job  has been terminated by  a 'global'
  92.   error (eg  error reading  the physical  file), in  which case  the CJLI
  93.   terminates itself after transferring the file to the postmaster. Within
  94.   a given  job, commands are  executed in sequential order  regardless of
  95.   the result of the previous commands.
  96.  
  97.     Each job  generates a separate 'output',  which is sent to  its reci-
  98.   pients (see  below) before  the next sequential  job is  executed. This
  99.   'output' consists in  a series of messages which  are (unless specified
  100.   otherwise -- see below) sent back as a single mail file.
  101.  
  102.  
  103.     There are basically three kind of cards in a job stream:
  104.  
  105.   1) Control cards, which start with "//" in column 1 and are interpreted
  106.      by the CJLI. Control cards  further subdivide into three categories:
  107.  
  108.       a) Pre-execution  control cards, of  the form: "//label  kwd args".
  109.          "label" and  "args" can  be omitted  but there  must still  be a
  110.          blank between the "//" string and the keyword name, ie "// kwd".
  111.          If  CJLI does  not  recognize  the keyword,  it  strips off  the
  112.          leading  "//" and  considers  the card  as  a command-card  (see
  113.          below).
  114.  
  115.       b) Comments, of  the form: "//* any_comment_text".  These cards are
  116.          merely ignored by CJLI. Note  the blank between the asterisk and
  117.          the first character of the comment text.
  118.  
  119.       c) Execution  time   control  cards,   of  the   following  format:
  120.          "//*kwd  args". Note  that the  keyword is  concatenated to  the
  121.          "//*" string to differentiate  this from a comment.  If the key-
  122.          word is not recognized, the card is treated as a comment control
  123.          card and ignored. It is otherwise processed by CJLI at execution
  124.          time, as if it were a normal command card, and in sequence order
  125.          with the other command cards.  These cards are actually commands
  126.          which are only available from  within a command job because they
  127.          would be irrelevant outside of a job context.
  128.  
  129.   2) Command cards, which  contain the text of the actual  commands to be
  130.      executed. They  are ignored by  CJLI which  passes them to  the main
  131.      LISTSERV command interpreter for execution.  If the card starts with
  132.      an asterisk, it is treated as a comment and ignored.
  133.  
  134.   3) Data cards,  which are assembled into  a dataset under control  of a
  135.      "// DD" control card.  They are removed from the job  stream by CJLI
  136.      and are kept in a separate pool for later reference at command execu
  137.      tion time.
  138.  
  139.  
  140. *****************************************
  141. * Control Cards -- general syntax rules *
  142. *****************************************
  143.  
  144.     All  control cards,  except comment  control cards,  follow the  same
  145.   syntaxic rules:
  146.  
  147.  
  148.   1) A control card starts with the string "//" in column 1.
  149.  
  150.   2) Control cards can span any  number of physical records: continuation
  151.      cards can  be defined  by placing a  comma at the  end of  the first
  152.      physical  line, and  having  the continuation  card  start with  the
  153.      string "// " (note the blank) in column 1. This process can be repea
  154.      ted any number of times. No blank is inserted between the end of the
  155.      first card and the beginning of the continuation card; however, any-
  156.      thing before the comma is kept. Examples:
  157.  
  158.      //card1  DD  "Some very long text which,
  159.      //            requires a continuation card"
  160.      --> "Some very long text whichrequires a continuation card"
  161.  
  162.      //card1  DD  "Some very long text which,
  163.      //                                requires a continuation card"
  164.      --> "Some very long text whichrequires a continuation card"
  165.  
  166.      //card1  DD  "Some very long text which  ,
  167.      //            requires a continuation card"
  168.      --> "Some very long text which  requires a continuation card"
  169.  
  170.      Since this approach  makes it impossible to "cut" a  line which ends
  171.      in a  large string of blanks,  an alternate method was  designed for
  172.      blanks-sensitive cutting.  If the continuation card  starts with the
  173.      string "//+  " in column 1  instead of just "//  ", the continuation
  174.      card is not stripped of leading blanks and data from columns 5-80 is
  175.      appended to the first card. Examples:
  176.  
  177.      //card1  DD  "Some very long text which,
  178.      //+ requires a continuation card"
  179.      --> "Some very long text whichrequires a continuation card"
  180.  
  181.      //card1  DD  "Some very long text which,
  182.      //+  requires a continuation card"
  183.      --> "Some very long text which requires a continuation card"
  184.  
  185.   3) Control cards can  contain a label of any length  starting in column
  186.      3. This label is  translated to uppercase. If the  label is omitted,
  187.      there must be a blank in column 3. The label can contain any charac-
  188.      ter, except blank and the slash sign ("/").
  189.  
  190.   4) The label is  followed by at least  one blank. The next  word in the
  191.      card is the "card name", which is translated to uppercase.
  192.  
  193.   5) Arguments can be specified after the  "card name", and must be sepa-
  194.      rated from  it by  at least  one blank.  Arguments are  separated by
  195.      commas, and there must not be  any blank before nor after the comma.
  196.      There are two categories of arguments:
  197.  
  198.        a) Positional  arguments, which must  appear in the  correct order
  199.           (which will usually depend on action being performed).
  200.  
  201.        b) Keywords,  of the  form  "name=data". They  can  appear in  any
  202.           order and  can be  freely intermixed with  positional keywords.
  203.           They do not  affect the sequence order  of positional keywords.
  204.           Keyword names are translated to  uppercase, and can contain any
  205.           character except blank, comma, double-quote or equal sign.
  206.  
  207.      For example,  //JOB1 JOB  XDZ,ECHO=NO,FRECP11,PW=EMERALD
  208.                    //JOB1 JOB  PW=EMERALD,XDZ,FRECP11,ECHO=NO
  209.              and   //JOB1 JOB  Echo=NO,pW=EMERALD,XDZ,FRECP11
  210.  
  211.      Are three different wordings of the same arguments string.
  212.  
  213.      There are furthermore two different forms of "data" for arguments:
  214.  
  215.        a) Quoted data: in that case the data is enclosed in double quotes
  216.           and can  contain one or more  blank delimited words as  well as
  217.           leading or trailing blanks.  Quoted data is case-sensitive, and
  218.           can contain any character except a double-quote.
  219.  
  220.        b) Non-quoted data:  in that  case the data  consists of  a single
  221.           word (ie blanks cannot appear in the data), which is translated
  222.           to uppercase. Non-quoted data cannot contain blanks, commas nor
  223.           double-quotes.
  224.  
  225.      In the above example, specifying 'Echo=No' is functionally identical
  226.      to 'ECHO=NO',  while 'Echo="No"' would  leave the argument  in mixed
  227.      case. Quoted data  is used for list of  recipients, full-names, etc.
  228.  
  229.   6) Comments can be included at the end of the card, and must be separa-
  230.      ted from the arguments by at least one blank. If you did not specify
  231.      any argument string, and still want  to place comments at the end of
  232.      the control card, you must specify a null argument string before the
  233.      comments by putting a ", " before the comment text, eg:
  234.  
  235.                //JOB1 JOB , These are comments
  236.                //JOB1 JOB XDZ,FRECP11 These are comments too
  237.  
  238.  
  239. ************************
  240. * The JOB control card *
  241. ************************
  242.  
  243.     The JOB control card indicates the start of a new job and allows you
  244.   to define several "execution options" for the job. The format of the
  245.   JOB card is:
  246.  
  247.     //jobname JOB options
  248.  
  249.   'jobname' is the  name you want to  assign to the job. If  you leave it
  250.             blank, CJLI will default it to be your 'userid'.
  251.  
  252.   The following options are available:
  253.  
  254.   - Echo=YES|NO
  255.     The default  value (if the keyword  is omitted) is YES  and indicates
  256.     that each command must be echoed  to the job output before execution.
  257.     The command  is then prefixed  with a "> ",  and preceded by  a blank
  258.     line on the job output.
  259.  
  260.   - Reply-to=Sender|None|"u@n1 u@n2..."
  261.     The default  value is "Sender" and  indicates that the output  of the
  262.     job is to be sent to the  sender of the job. "None" indicates that no
  263.     output should  be generated,  and is  used whenever  the sender  is a
  264.     server which is not programmed to parse the output of a LISTSERV job.
  265.     Also it makes sure  that no loop can ever occur due to  an error in a
  266.     job. "u@n1 u@n2..." can be used whenever  replies are to be sent to a
  267.     different person/list of persons. These  persons will first receive a
  268.     messages telling them  that they are receiving the  output of another
  269.     person's job.
  270.  
  271.   - Reply-via=Mail|Message|MSG
  272.     The default  value, "Mail", indicates  that the  job output is  to be
  273.     sent to  its recipients  in the  form of a  mail file.  "Message" and
  274.     "MSG" both indicate that interactive  messages are desired. Note that
  275.     an attempt to send interactive messages to a node which cannot handle
  276.     them will result  in LISTSERV sending a piece of  mail containing the
  277.     text of the various messages.
  278.  
  279.   - PW=password
  280.     Is the  default password to use  on commands where an  explicit "PW="
  281.     keyword has  not been  specified. It  makes it  easier to  write jobs
  282.     performing  several maintenance  commands  on  the same  distribution
  283.     list, for example.
  284.  
  285.     All other keywords, as well as positional parameters, are ignored. If
  286.   an invalid value is specified for  a valid keyword, the job is termina-
  287.   ted by CJLI but the remaining jobs  in the physical file are still exe-
  288.   cuted.
  289.  
  290.     If the JOB card is omitted, the 'outer' interface provides the follo-
  291.   wing default JOB card:
  292.  
  293.      //userid JOB Echo=Yes,Reply-to=Sender,Reply-via=Mail,PW=""
  294.  
  295.  
  296. ************************
  297. * The EOJ control card *
  298. ************************
  299.  
  300.     The EOJ card indicates the end of a job; its syntax is very simple:
  301.  
  302.          //anything EOJ
  303.  
  304.   where 'anything' can be any valid  label and is completely ignored. The
  305.   'outer' interface provides  an EOJ card at the end  of the physical job
  306.   file, as  well as before a  new JOB card,  if none was provided  by the
  307.   user.
  308.  
  309.  
  310. ***********************
  311. * The DD control card *
  312. ***********************
  313.  
  314.     The DD control card allows you to define single or multi-line 'data-
  315.   sets' for use by the various commands in the job stream. The syntax of
  316.   the DD card is the following:
  317.  
  318.       //ddname DD "single-line-constant"
  319.                   *
  320.                   *,EOF
  321. !                 *,EOF,Res=Disk
  322.  
  323.   'ddname' is  the name the  dataset is to be  given. It must  follow the
  324.            general label naming convention,  cannot be omitted and cannot
  325.            appear more  than once  in the job  stream. That  is, datasets
  326.            cannot be concatenated by means of several DD cards.
  327.  
  328.   "xxxxxx" denotes a single-line dataset, whose value is that of the
  329.            first (quoted) argument. The length of this argument must not
  330.            exceed 255 bytes.
  331.  
  332.   '*'      denotes a multi-line dataset, whose successive lines immediate
  333.            ly follow the DD card. Any  number of lines can thus be inclu-
  334.            ded in a  dataset, with a "/*" line indicating  the end of the
  335.            dataset. The JCL "DD DATA,DLM='xxxx'" is not implemented. Note
  336.            that unlike JCL, CJLI does NOT  end the dataset when a control
  337.            card (ie one starting with "//") is encountered; the "/*" must
  338.            always be specified.
  339.  
  340.   '*,EOF'  denotes a multi-line dataset, whose successive lines immediate
  341.            ly follow the DD  card and end at the end  of the PHYSICAL job
  342.            file. This option is used  when transmitting "unknown" data in
  343.            a dataset which  could a priori contain any  kind of character
  344.            string. Needless to say, there can be only one such dataset in
  345.            the job file, and it must be the last dataset in the last job.
  346.  
  347. ! 'Res='   indicates whether the  dataset is to reside  in storage ("Res=
  348. !          Storage") or  on disk  ("Res=Disk"). In some  cases it  may be
  349. !          necessary to keep a large dataset on disk to avoid running out
  350. !          of storage and to improve  execution speed when a disk-file is
  351. !          to be generated  anyway by the command using  the dataset. The
  352. !          "Res=" keyword is therefore ignored on all datasets except the
  353. !          '*,EOF' one (if present), and causes a disk file to be genera-
  354. !          ted with the remainder of the input deck. Please note that not
  355. !          all  commands will  support  the  "Res=Disk" option:  commands
  356. !          which do not  expect to receive a large dataset  as input will
  357. !          usually expect to find it in  storage and report an error when
  358. !          the "Res=Disk"  option is used. For  example, DISTRIBUTE fully
  359. !          supports "Res=Disk" while DELETE doesn't.
  360. !
  361.     An invalid  dataset declaration  causes the job  to be  terminated by
  362.   CJLI with the remaining jobs in the physical file still being executed.
  363.  
  364.  
  365. ***************************
  366. * The //*MSG control card *
  367. ***************************
  368.  
  369.     The "//*MSG"  execution-time control  card allows you  to selectively
  370.   halt/resume 'typing  on the  job output' or  to discard  messages which
  371.   have been previously output during execution  of the job. Note that the
  372.   latter option  has no  effect when  the output  of the  job is  sent as
  373.   interactive messages,  as it  is intended to  control mail  job output.
  374.  
  375.   The syntax of the "//*MSG" control card is:
  376.  
  377.      //*MSG option1,option2,...
  378.  
  379.   Valid options are: ON, OFF, FLUSH
  380.  
  381.     FLUSH  discards  all messages previously  sent to the job  output and
  382.            leaves the message-receipt status unchanged.
  383.  
  384.     OFF    turns message receipt off, as if "Reply-to=None" had been spe-
  385.            cified in the JOB card.
  386.  
  387.     ON     turns message receipt back on. This does NOT override a possi-
  388.            ble "Reply-to=None" in the JOB card, though.
  389.  
  390.  
  391. **************************
  392. * Special considerations *
  393. **************************
  394.  
  395.     This section contains more information on the trickiest parts of CJLI
  396.   as well as some useful hints for application programmers.
  397.  
  398.     Because there are some list servers  on the network that require mail
  399.   to be  sent to the  LISTSERV userid in  order to be  distributed, while
  400.   Revised LISTSERV treats anything mailed to the LISTSERV userid as a set
  401.   of commands to execute, it was decided  that as soon as an unknown com-
  402.   mand is encountered in the job stream, the whole physical job file (not
  403.   just the current job) is immediately flushed and discarded. This avoids
  404.   'executing' hundreds  of unknown commands  and sending back a  huge job
  405.   output when a regular mailfile is  sent to the LISTSERV userid by some-
  406.   one who  thought it would  be distributed to  a list. Note  that errors
  407.   from known commands do not cause termination of the job -- only comple-
  408.   tely unknown commands such as "Hiya!!" would terminate the job.
  409.  
  410.     Although CJLI  is based  on the  network standard  80-characters card
  411.   images,  LISTSERV  accepts command  jobs  in  several network  formats,
  412.   including Disk Dump and Netdata. In that case it will accept records of
  413.   up to  255 characters as input,  and you may find  this very convenient
  414.   when sending long commands to the server.
  415.  
  416.     Alternatively, continuation cards can be  used to split long commands
  417.   into several 80-characters cards. In that  case you must insert a "// "
  418.   string before the  command text so that CJLI considers  it as a control
  419.   card and performs the required concatenation; it will then realize that
  420.   the "card name"  is unknown and transform the card  into a regular com-
  421.   mand card. If you  opt for that method, you will  find the "//+" conti-
  422.   nuation card feature very convenient for a program (but not for a human
  423.   person). This method is used by LISTSERV when transmitting "DISTRIBUTE"
  424.   commands to other LISTSERVs.
  425.  
  426.     There is no limit  at all on the final size of a  control card, ie on
  427.   the number  of continuation  cards you can  specify; however,  you must
  428.   make sure that no line in any of the 'datasets' ever exceeds 255 charac
  429.   ters.  In particular,  if  the physical  job file  is  sent in  Netdata
  430.   format, you must make sure that the  file lrecl is not higher than 255.
  431.  
  432.     Due to internal coding considerations,  it is recommended that physi-
  433.   cal job files  be sent to LISTSERV  in PUNCH format. This  will make it
  434.   easier for the 'outer' interface to detect  the job file for what it is
  435.   and  will save  some  CPU time  to the  server,  thereby improving  job
  436.   response time. Please keep in mind that DD lines longer than 80 charac-
  437.   ters cannot be sent in PUNCH format.
  438.  
  439.     For more information  on how to send commands to  LISTSERV for execu-
  440.   tion, see LISTSERV MEMO.
  441.