View previous topic :: View next topic |
Author |
Message |
naveen_summary Beginner
Joined: 12 Feb 2007 Posts: 26 Topics: 13
|
Posted: Wed Jul 15, 2009 10:37 am Post subject: NETSTATS in batch REXX |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Jul 15, 2009 10:58 am Post subject: |
|
|
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 |
|
 |
naveen_summary Beginner
Joined: 12 Feb 2007 Posts: 26 Topics: 13
|
Posted: Wed Jul 15, 2009 11:47 am Post subject: |
|
|
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 |
|
 |
naveen_summary Beginner
Joined: 12 Feb 2007 Posts: 26 Topics: 13
|
Posted: Wed Jul 15, 2009 12:02 pm Post subject: |
|
|
And sorry I forgot to mention the NETSTAT command is supposed to allocate the dataset. |
|
Back to top |
|
 |
|
|