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: 4648
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
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm


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