|
Hi,
I would like to make a datastep execute an external command with an unnamed
pipe which changes arguments based on data read into the datastep and then
parse the STDOUT. My first attempts have not been fruitful, as only the
pipe with the last assigned value gives me output. Can I change the
filename pipe in a loop in the datastep and parse the output of the pipe in
a DOW loop? If not, why not, and is there a workaround?
I think that my problem can be illustrated in the following log with the
attendant question: why is only the output from the second command output,
and not the first?
TIA,
Matt
------
239 DATA _NULL_;
240 FILENAME NSLKUP PIPE 'NSLOOKUP 207.255.105.92';
241 INFILE NSLKUP END=EOF;
242 DO UNTIL (EOF);
243 INPUT;
244 PUT _INFILE_;
245 END;
246 FILENAME NSLKUP CLEAR;
NOTE: Fileref NSLKUP has been deassigned.
247 FILENAME NSLKUP PIPE 'NSLOOKUP 207.255.105.93';
248 INFILE NSLKUP END=EOF;
249 DO UNTIL (EOF);
250 INPUT;
251 PUT _INFILE_;
252 END;
253 RUN;
NOTE: The infile NSLKUP is:
Unnamed Pipe Access Device,
PROCESS=NSLOOKUP 207.255.105.93,RECFM=V,
LRECL=256
Server: eg-ecomdc-a05.ecom.tlrg.com
Address: 167.68.80.161
Name: 207-255-105-093-dhcp.unt.pa.atlanticbb.net
Address: 207.255.105.93
NOTE: 6 records were read from the infile NSLKUP.
The minimum record length was 0.
The maximum record length was 51.
NOTE: DATA statement used (Total process time):
real time 0.07 seconds
cpu time 0.00 seconds
|