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 

NETSTATS in batch REXX

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


Joined: 12 Feb 2007
Posts: 26
Topics: 13

PostPosted: Wed Jul 15, 2009 10:37 am    Post subject: NETSTATS in batch REXX Reply with quote

Hello,

I need to get the netstats for an IP (Thales Device) into a dataset using REXX program. I am abel to acheive this when i execute the rexx from command prompt but this does not work when executed in batch. Can you please help?

Rexx Code:

Code:
/** REXX  **/                         
 Address TSO                         
 /* execute the netstat command */   
 ARG C                               
 say c                               
 b=172.20.45.75                       
 qou="'"                             
 brac=")"                             
 d=' (ipaddr '                       
 a='netstat byte report DSN '         
  /* build the command */             
 a=a||qou||c||qou||d||b||brac         
 say a                               
 ADDRESS TSO                         
 a                                   


JCL code:

Code:
//STEP1  EXEC PGM=IKJEFT01,REGION=4096K,           
//       PARM=('REXX1 G590900.TESTRPT')             
//SYSPROC   DD DSN=G590900.T0XXXXXX.REXX,DISP=SHR   
//SYSPRINT  DD SYSOUT=*                             
//SYSTSPRT  DD SYSOUT=*                             
//SYSTSIN   DD DUMMY                               
//SYSIN     DD *                                   



Thanks[/code]
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Jul 15, 2009 10:58 am    Post subject: Reply with quote

naveen_summary,

1. When invoked in batch you need to use % before the rexx name exec
2. Since you are passing parms to the exec you need to use PULL in your rexx exec
3. You are not allocating your output dataset.

Here is a sample.

Code:

//STEP1  EXEC PGM=IKJEFT01,REGION=4096K,     
//       PARM=('%REXX1 G590900.TESTRPT')   
//SYSPROC   DD DSN=KOLUSU.REXX.EXEC,DISP=SHR
//SYSPRINT  DD SYSOUT=*                     
//SYSTSPRT  DD SYSOUT=*                     
//SYSTSIN   DD DUMMY



REXX Code

Code:

/** REXX  **/                                           
 PULL ARG                                               
 SAY ARG(1)                                             
 A = "NETSTAT BYTE REPORT DSN "||,                       
     "'"||ARG(1)||"'"||" (IPADDR "||"172.20.45.75"||")" 
 SAY A                                                   
Back to top
View user's profile Send private message Send e-mail Visit poster's website
naveen_summary
Beginner


Joined: 12 Feb 2007
Posts: 26
Topics: 13

PostPosted: Wed Jul 15, 2009 11:47 am    Post subject: Reply with quote

Kolusu, thanks for your reply.

I made the %change but I think the other changes are not necessary as I get the below statements in my output. As you can see the first 3 statements are output of a REXX SAY command. Beyond that (4th and 5th lines) are the error messages.

/* Output statements */

G030102.TESTRPT
G030102.TESTRPT
netstat byte report DSN 'G030102.TESTRPT' (ipaddr 172.20.13.75)
Could not establish affinity with TCPIP (1011/11B3005A) - can not provide
the requested option information
READY
END
Back to top
View user's profile Send private message
naveen_summary
Beginner


Joined: 12 Feb 2007
Posts: 26
Topics: 13

PostPosted: Wed Jul 15, 2009 12:02 pm    Post subject: Reply with quote

And sorry I forgot to mention the NETSTAT command is supposed to allocate the dataset.
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