Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How can i get the computer name through rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
draviki

New User


Joined: 02 Dec 2005
Posts: 5

PostPosted: Fri Feb 24, 2006 4:23 pm    Post subject: How can i get the computer name through rexx
Reply with quote

Hi,

Could you please help me out in getting the computer name through rexx
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Fri Feb 24, 2006 4:58 pm    Post subject:
Reply with quote

Take a look at the MVSVAR function in the fine manual.

O.
Back to top
View user's profile Send private message
draviki

New User


Joined: 02 Dec 2005
Posts: 5

PostPosted: Fri Feb 24, 2006 5:25 pm    Post subject: Re: How can i get the computer name through rexx
Reply with quote

Thanks for the reply.

but i need the ipaddress of the computer through which i have logged in.
Back to top
View user's profile Send private message
brgr88

New User


Joined: 05 Mar 2006
Posts: 6

PostPosted: Sun Mar 05, 2006 5:53 am    Post subject:
Reply with quote

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
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Mon Mar 06, 2006 10:04 am    Post subject:
Reply with quote

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
View user's profile Send private message
Paddy

New User


Joined: 12 Sep 2005
Posts: 46
Location: Paris France

PostPosted: Mon Mar 06, 2006 3:07 pm    Post subject:
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Mon Mar 06, 2006 3:18 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Paddy

New User


Joined: 12 Sep 2005
Posts: 46
Location: Paris France

PostPosted: Mon Mar 06, 2006 3:58 pm    Post subject:
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Fri Mar 10, 2006 3:13 pm    Post subject:
Reply with quote

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
View user's profile Send private message
draviki

New User


Joined: 02 Dec 2005
Posts: 5

PostPosted: Fri Mar 10, 2006 5:12 pm    Post subject:
Reply with quote

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
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4649
Location: Raleigh, NC, USA

PostPosted: Fri Mar 10, 2006 7:18 pm    Post subject: Re: How can i get the computer name through rexx
Reply with quote

Interesting. Works for me. TCP/IP not active maybe?
Back to top
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Fri Mar 10, 2006 10:30 pm    Post subject: Re: How can i get the computer name through rexx
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Iterative use of a REXX script causin... bryonyh CLIST & REXX 0 Fri Jul 28, 2017 12:52 pm
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us