MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need a REXX exec to issue Console Commands

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
bonie
Beginner


Joined: 18 Feb 2007
Posts: 5
Topics: 3

PostPosted: Fri Jan 31, 2014 6:38 am    Post subject: Need a REXX exec to issue Console Commands Reply with quote

Hi
Is there a way to execute MVS Console commands within REXX and get the output in a dataset.

For: I have to execute task checks by issuing command like \
D T,
D SMF
D CON etc every 30mins and check the output.

Any help is appreciated.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri Jan 31, 2014 12:19 pm    Post subject: Reply with quote

bonie,

Try this untested code

Code:

/* REXX TO ISSUE CONSOLE COMMANDS */
CMD.1 = 'D T'                       
CMD.2 = 'D SMF'                     
CMD.3 = 'D CON'                     
"CONSOLE ACTIVATE"                   
DO X = 1 TO 3                         
"CONSOLE SYSCMD("CMD.X")"           
MCODE=GETMSG('RESMSG1.','SOL',,,60) 
IF RESMSG1.0 = 0 THEN DO             
  SAY 'NO MESSAGE RETURNED'         
  RETURN                             
END                                 
ELSE                                 
  DO I=1 TO RESMSG1.0               
    SAY RESMSG1.I                   
  END                               
  RESMSG1.0=0                       
END                                 
"CONSOLE DEACTIVATE"                 
EXIT                                 


Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bonie
Beginner


Joined: 18 Feb 2007
Posts: 5
Topics: 3

PostPosted: Sat Feb 01, 2014 5:04 am    Post subject: Worked fine..thanks Reply with quote

Thanks Kolusu...it worked fine..
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group