STACK is a TSO command processor which enables interception of PUTGET IO for the duration of the TSO command following STACK.  Thus the output from a TSO command may be directed to a dataset.  STACK imitates the TMP to obtain the next TSO command and attach it with the IO redirected via the STACK macro.  STACK can be used to execute a command from a specific library (for example a test version) or to call a program using dynamic linkage since the optional TASKDD is also used as the tasklib for the duration of the command.  VIO datasets may be used for the IO files. All operands are optional.  All file I/O must be done via PUTGET module to be intercepted. 

The source for STACK is located in File #270 of the CBT tape.  It also requires two additional module - KMDPARS and OPERSCAN - as well as several macros, all also located in File #270.  STACK was written by Kermit Kiser at the Washington Department of Information Services in Olympia, WA.



All of the necessary source, macros, and help text has been combined into a single install jobstream.  The jobstream - stack$.jcl - is contained in the archive:  stack.tgz [MD5: 6AB1C9C1B27774C33716EF3E166FC87C].  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 STACK 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 STACK

I have not done extensive testing of STACK; I installed it because I had been asked if something like this could be done on MVS 3.8j and when I came across the documentation for STACK, it provided exactly the functionality that I had been asked about.  STACK does an excellent job of capturing output from a LISTCAT, which was the desired function in the original query.  Remember that in order to capture output, the output must be produced via PUTGET.

Here is the help text for the STACK command:

SYNTAX  -                                                             
        STACK DDIN(INPUTDD) DDOUT(OUTDD) -                            
              TASKLIB(TASKDD) LIST                                    
  REQUIRED - none                                                     
  ALIAS    - none                                                     
OPERANDS -                                                            
        INPUTDD - DDNAME to read command from instead of normal       
                  source (TSO terminal)                               
        OUTDD   - DDNAME the command output should go to instead      
                  of the TSO terminal                                 
        TASKDD  - DDNAME the command should be attached from          
        LIST    - causes the command to be written to the output      
                  file in front of output from command                



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 .