INSTREAM TSO CLIST Command

INSTREAM is a TSO command that provides a means to pass embeded statements in a Command List to an invoked program.

I retrieved it from File #300 of the #437 version of the CBT tape and is part of a collection of TSO commands from Jim Marshall of the Air Force.  It was originally written by Bill Godfrey at the Planning Research Corporation in July of 1976.

Installation

There are no changes required to assemble this command under MVS 3.8j as it exists on the CBT tape.  The added value of using the installation jobstream here is that the JCL has been provided that will install the command with minimal effort and the jobstream also installs the HELP text module that will be accessible from TSO.  The single jobstream to assemble and link-edit the load module and install the help text - instream.jcl - is contained in the archive instream.tgz [MD5: E1CF63E3CFC7CD361F979C8B12583BD7].  Download the archive and extract the jobstream (WinZip on Windows/?? or tar on Linux).  Submit the jobstream to assemble and link the single load module for INSTREAM into SYS2.CMDLIB and copy the help text into SYS2.HELP.  If you don't have SYS2.CMDLIB defined, you will need to modify the jobstream to specify a different target load library.  Also if you do not have SYS2.HELP defined, you may modify the jobstream to place the help information into SYS1.HELP.

 

Utilizing INSTREAM

From the help text:

Function -

  The instream command allocates a temporary dataset for utility control statements 
  and copies subsequent CLIST or terminal input to that dataset.

  The copying continues until an END statement is encountered.    This is useful in 
  CLISTs that call utility programs that require 80-character control statement input.  
  Since the control  statements are part of the CLIST, their contents can be set
  by variables in the CLIST.

Syntax  -

  INSTREAM    FILE(<ddname>)    END(<string>)    BLKSIZE(<size)
                          REUSE    CONTIN    INSERT
  required - none
  defaults - FILE(SYSIN)    END(END)    INSERT
  alias - none
                                                                        
 Operands -                                                             

  FILE(<ddname>) - the DD name to which the new temporary dataset is to be 
                                allocated.  If not specified, FILE(SYSIN) is used.  The DD
                                name must not be currently allocated, unless REUSE is specified.
  REUSE - This keyword indicates that if the DD name is currently allocated, it is
                  to be freed and then re-allocated to the new temporary dataset.
  BLOCK(<size>) - The block size of the temporary dataset.  If not specified, 400 is
                                used.
  END(<string>) - The string that will replace END as the delimiter of the input data.
  INSERT - This keyword specifies that if an input line starts with the characters I, IN,
                   or INSERT followed by a blank, only the data following the blank will 
                   be copied.
                   This allows you to indent your CLIST and still control leading blanks in
                    your input data.
  CONTIN - This keyword indicates that the first byte of data in each input line is to
                     be put in column 72, and bytes 2 through 72 shifted over to 1 through
                     71.  This option is useful if the utility program uses column 72 for
                     continuation.                  
 

An example CLIST (statements in red show INSTREAM use):

PROC 1 VOL 
FREE DA(TEMP) 
ALLOC DA(TEMP) NEW DELETE UNIT(SYSDA) VOL(&VOL) 
FREE FI(SYSIN) 
INSTREAM 
DATA 
    LISTVTOC VOL=SYSDA=&VOL.,FORMAT 
END 
ENDDATA 
ALLOC F(SYSPRINT) DA(*) 
CALL 'SYS1.LINKLIB(IEHLIST)' 
FREE FI(SYSIN) 
FREE DA(TEMP) 
EXIT 

Enclosing the lines processed by the INSTREAM command in a DATA-ENDDATA block prevents the leading spaces from being stripped by the command processor.  The LISTVTOC statement contains a symbolic variable - &VOL - which will have the value contained in VOL substituted when the statement is interpreted.


I hope that you have found my instructions useful.  If you have questions that I can answer to help expand upon my explanations and examples shown here, please don't hesitate to send them to me:


Return to Site Home Page 


This page was last updated on January 17, 2015 .