Hi Randy,
For DOS commands in CA Automation Point yoiu can use the ADDRESS CMD function... It's to enter DOS commands...
Here a sample of such rexx doing a NSLOOKUP and writing it to a file.. Later also reading the file and displaying it...
/* NSLOOKUP rexx */
parse upper arg IPAddress
/* If not argument is passed, use localhost */
if IPAddress = '' then IPAddress = 'localhost'
Say "--- NSLOOKUP is used for a check on " IPAddress" ("time()")---"
/* Trace I */
/* Create a unique output file name using a random number generator */
/* to prevent overwriting files previously created */
/* Default limits are 0 and 999 Max of range cannot be more */
/* than 100000 */
TNUM = RANDOM(0, 999)
/* Make unique file name and store in FNAME */
FNAME = 'OUT'||TNUM||'.DAT'
/* Run DOS command */
ADDRESS CMD 'NSLOOKUP' IPAddress '> ' FNAME
Say 'RC NSLOOKUP: ' rc
/* Read a line at the time using the LINEIN command */
/* Do while until end of output file NSlookup */
DO WHILE LINES(FNAME)>0
TESTIN = LINEIN(FNAME)
SAY 'Output NSLOOKUP :' TESTIN
END
/* */
Return
The output shows :
--- NSLOOKUP is used for a check on localhost (07:31:18)---
RC NSLOOKUP: 0
Output NSLOOKUP : Server: zzzzzz.dddddddd.xxxx
Output NSLOOKUP : Address: nnn.nn.nnn.nn
Output NSLOOKUP :
Output NSLOOKUP : Name: localhost
Output NSLOOKUP : Address: 127.0.0.1
Output NSLOOKUP :
Best regards,
Hennie Hermans
------------------------------
Principal Support Engineer
CA Technologies, A Broadcom Company
------------------------------
Original Message:
Sent: 08-03-2020 11:30 AM
From: Randy Knapton
Subject: Question on rexx
Hello,
Is there an easy way to capture output from NSLookup command in automation point? I would like it as a variable to pass in my rexx code.