Page 1 of 1

TSO COMMAND LISTUSER OUTPUT NEED TO BE WRITTEN WRITEN

PostPosted: Tue Jun 19, 2018 7:08 pm
by Bakar1717
I am using listuser command on ISPF Commad shell
Command LISTUSER, I am getting output displayed
but I need this in the MF file. how I can do this?
Thanks

Re: TSO COMMAND LISTUSER OUTPUT NEED TO BE WRITTEN WRITEN

PostPosted: Tue Jun 19, 2018 7:29 pm
by NicC
What is 'the MF file'?
Do you mean that you want the results in a data set? If so, one way is to simply cut and paste using the terminal emulator facility (usually ctrl-c and ctrl-v).
I do not know the LISTUSER command - perhaps it is the RACF LU command. If so, look up the help and see if it specifies how to write the output to data set (you won't get it into a file unless you transfer the data set from the mainframe to a PC or *nix box or cu and paste into a PC or *nix box).

Re: TSO COMMAND LISTUSER OUTPUT NEED TO BE WRITTEN WRITEN

PostPosted: Tue Jun 19, 2018 7:40 pm
by Bakar1717
I want displaying output to be written into mainframe dataset. I did not find in help
How to do it or how I can execute any command and bath mode.
I cannot do cut and paste since there are hundred of pages

Re: TSO COMMAND LISTUSER OUTPUT NEED TO BE WRITTEN WRITEN

PostPosted: Tue Jun 19, 2018 7:56 pm
by Robert Sample
Run the command in batch and use SDSF (or whatever spool manager your site uses) to write the output to a data set.

Re: TSO COMMAND LISTUSER OUTPUT NEED TO BE WRITTEN WRITEN

PostPosted: Tue Jun 19, 2018 8:23 pm
by prino
/* REXX exec to view the output of a TSO command                      */
/*** trace ?r ***************************************************** \| *
*               (C) Copyright Robert AH Prins, 2007-2007               *
************************************************************************
*  ------------------------------------------------------------------  *
* | Date       | By   | Remarks                                      | *
* |------------+------+----------------------------------------------| *
* |            |      |                                              | *
* |------------+------+----------------------------------------------| *
* | 2007-08-09 | RAHP | Give message for missing command             | *
* |------------+------+----------------------------------------------| *
* | 2007-07-10 | RAHP | Initial version                              | *
* |------------+------+----------------------------------------------| *
************************************************************************
* VI is a REXX exec to view the output of a TSO command.               *
************************************************************************
* Send questions, suggestions and/or bug reports to:                   *
*                                                                      *
* robert(a)prino.org / robert.ah.prins(a)gmail.com                     *
*                                                                      *
* Robert AH Prins                                                      *
* Ozkiniu gatve 48                                                     *
* 08410 Vilnius                                                        *
* Lithuania                                                            *
************************************************************************
* This program is free software: you can redistribute it and/or        *
* modify it under the terms of the GNU General Public License as       *
* published by the Free Software Foundation, either version 3 of       *
* the License, or (at your option) any later version.                  *
*                                                                      *
* This program is distributed in the hope that it will be useful,      *
* but WITHOUT ANY WARRANTY; without even the implied warranty of       *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the         *
* GNU General Public License for more details.                         *
*                                                                      *
* You should have received a copy of the GNU General Public License    *
* along with this program. If not, see <http://www.gnu.org/licenses/>  *
***********************************************************************/
parse source source
parse value source with . . moi .

"ispexec control errors return"

arg tsocmd

if strip(tsocmd) = '' then
  do
    say 'The' moi 'command needs a TSO command as parameter'
    exit
  end

dynds = 'dyn' || random(99999)
junk  = msg(off)

"alloc f("dynds") new delete reu " ||,
                 "unit(sysda) " ||,
                 "space(150,150) tracks release " ||,
                 "recfm(f b) lrecl(140) blksize(0) "
junk = msg(on)

junk = outtrap(LINE.)
address tso tsocmd
junk = outtrap('off')

"execio" line.0 "diskw" dynds "(stem line. finis"
"ispexec lminit dataid(temp) ddname("dynds")"
"ispexec view   dataid("temp")"
"ispexec lmfree dataid("temp")"

junk = msg(off)
"free fi("dynds")" 

Usage: TSO vi {tso command} (e.g. TSO VI LU)

Re: TSO COMMAND LISTUSER OUTPUT NEED TO BE WRITTEN WRITEN

PostPosted: Tue Jun 19, 2018 9:44 pm
by Pedro
Prino's example uses a temporary data set. I think you would want to replace the ALLOCATE statement with one that references your data set name.

You did not say how often you will do this... if it is frequent, you may want to follow Robert's advice about a batch job, though I would recommend to allocate SYSTSPRT to your permanent dataset.

Re: TSO COMMAND LISTUSER OUTPUT NEED TO BE WRITTEN WRITEN

PostPosted: Wed Jun 20, 2018 12:19 am
by prino
Pedro wrote:Prino's example uses a temporary data set. I think you would want to replace the ALLOCATE statement with one that references your data set name.

I wouldn't, as you can always use "create .zf .zl" to create something (more) permanent.

Re: TSO COMMAND LISTUSER OUTPUT NEED TO BE WRITTEN WRITEN

PostPosted: Wed Jun 20, 2018 12:23 am
by Bakar1717
Thank you, All. Working well.

Re: TSO COMMAND LISTUSER OUTPUT NEED TO BE WRITTEN WRITEN

PostPosted: Tue Jun 26, 2018 12:27 am
by vasanthz
//STEP02   EXEC PGM=IKJEFT01            
//SYSPRINT DD SYSOUT=*                  
//SYSTSPRT DD DISP=OLD,DSN=WELLS.SORTIN   <-- OUTPUT DATASET
//SYSUDUMP DD SYSOUT=*                  
//SYSOUT   DD SYSOUT=*                  
//SYSTSIN  DD *                        
  LU USERID                            
//                                      


Hope it helps.