View previous topic :: View next topic
|
Author |
Message |
draviki
New User
Joined: 02 Dec 2005 Posts: 5
|
|
|
|
Hi,
Could you please help me out in getting the computer name through rexx |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Take a look at the MVSVAR function in the fine manual.
O. |
|
Back to top |
|
|
draviki
New User
Joined: 02 Dec 2005 Posts: 5
|
|
|
|
Thanks for the reply.
but i need the ipaddress of the computer through which i have logged in. |
|
Back to top |
|
|
brgr88
New User
Joined: 05 Mar 2006 Posts: 6
|
|
|
|
draviki,
Use MVSVAR to find your system name, then use the TSO PING command with the REXX OUTTRAP() function and parse the first line of output:
/* REXX - store local IP address into variable 'ip_address' */
sysname = MVSVAR('SYSNAME')
rc_out = OUTTRAP('ping.')
ADDRESS TSO "PING" sysname
rc_out = OUTTRAP('OFF')
PARSE VAR ping.1 .'('ip_address')'. |
|
Back to top |
|
|
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
Hi BRGR88,
By MVSVAR u r just getting to know in which system u r in. But by that u r trying to ping the system. That is not always possible. May be it is running in ur system but it will not work evry where. Because sometimes the admin shorts the privillage of using "tso ping" to a normal developer. |
|
Back to top |
|
|
Paddy
New User
Joined: 12 Sep 2005 Posts: 46 Location: Paris France
|
|
|
|
Hi Draviki
You can try this code to solve your problem.
Code: |
/* REXX */
/* Paddy */
TRACE o
CALL SOCKET 'INITIALIZE','RSCLIENT' /* initilize IP Connexion */
ADDR = SOCKET('GETHOSTID') /* retrieve ip addr */
PARSE VAR ADDR RT IPADD /* parse rt = return code ipadd ip address*/
SAY IPADD
exit
|
I hope in this help.
Best regards.
Paddy |
|
Back to top |
|
|
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
Hi Thanx Paddy,
Ur code is superb. Can u pls help me by providing the link for this network-related topics through REXX |
|
Back to top |
|
|
Paddy
New User
Joined: 12 Sep 2005 Posts: 46 Location: Paris France
|
|
|
|
Hi Amitva,
All the elements of code relating to TCP/IP network are described in
"IP Application Programming Interface Guide". If you need help for a point of detail. you lets me a private message on this site.
Best regards.
Paddy |
|
Back to top |
|
|
parikshit123
Active User
Joined: 01 Jul 2005 Posts: 269 Location: India
|
|
|
|
Hi Paddy,
I tried your code . but it gave me following error:
"ESUBTASKNOTACTIVE Subtask not active "
can you please tell me what might have gone wrong? |
|
Back to top |
|
|
draviki
New User
Joined: 02 Dec 2005 Posts: 5
|
|
|
|
Hi Paddy,
I agree with Parikshit.I too am gettting the same error message.
can u please help me out.
Regards
Ravi(DRAVIKI) |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Interesting. Works for me. TCP/IP not active maybe? |
|
Back to top |
|
|
parikshit123
Active User
Joined: 01 Jul 2005 Posts: 269 Location: India
|
|
|
|
Hi superk,
You are right. TCP/IP is not active at my site. The telnet is tunneled through a webservice.
However, the topic is really interesting. |
|
Back to top |
|
|
|