IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How can i get the computer name through rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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: 2359
Location: Israel

PostPosted: Fri Feb 24, 2006 4:58 pm
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
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
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
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
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
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
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
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
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

Global Moderator


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

PostPosted: Fri Mar 10, 2006 7:18 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Tilde Characters Changing to COLONs i... CLIST & REXX 17
No new posts DSN REXX VARBINARY inserts CLIST & REXX 4
No new posts How to modify file content using REXX CLIST & REXX 3
No new posts Same command as on commandline in REX... TSO/ISPF 6
No new posts process statement for SUPREC, CMPCOLM... TSO/ISPF 4
Search our Forums:

Back to Top