Dynamically generated PIPEs
data _null_;
command = 'nslookup 207.255.105.92';
infile ns1 pipe filevar=command end=eod1;
do until (eod1);
input;
put '(1) ' _infile_;
end;
command = 'nslookup 207.255.105.93';
infile ns2 pipe filevar=command end=eod2;
do until (eod2);
input;
put '(2) ' _infile_;
end;
stop;
run;
data _null_;
do command = 'nslookup 207.255.105.92', 'nslookup 207.255.105.93';
eod = 0;
infile nslookup pipe filevar=command end=eod;
do until (eod);
input;
put command ':' _infile_;
end;
end;
stop;
run;
prints
332 data _null_;
333 command = 'nslookup 207.255.105.92';
334 infile ns1 pipe filevar=command end=eod1;
335 do until (eod1);
336 input;
337 put '(1) ' _infile_;
338 end;
339 command = 'nslookup 207.255.105.93';
340 infile ns2 pipe filevar=command end=eod2;
341 do until (eod2);
342 input;
343 put '(2) ' _infile_;
344 end;
345 stop;
346 run;
NOTE: The infile NS1 is:
Unnamed Pipe Access Device,
PROCESS=nslookup 207.255.105.92,RECFM=V,
LRECL=256
(1) Server: spoke.dcn.davis.ca.us
(1) Address: 168.150.253.2
(1)
(1) Name: 207-255-105-092-dhcp.unt.pa.atlanticbb.net
(1) Address: 207.255.105.92
(1)
NOTE: The infile NS2 is:
Unnamed Pipe Access Device,
PROCESS=nslookup 207.255.105.93,RECFM=V,
LRECL=256
(2) Server: spoke.dcn.davis.ca.us
(2) Address: 168.150.253.2
(2)
(2) Name: 207-255-105-093-dhcp.unt.pa.atlanticbb.net
(2) Address: 207.255.105.93
(2)
NOTE: 6 records were read from the infile NS1.
The minimum record length was 0.
The maximum record length was 51.
NOTE: 6 records were read from the infile NS2.
The minimum record length was 0.
The maximum record length was 51.
NOTE: DATA statement used (Total process time):
real time 0.75 seconds
cpu time 0.01 seconds
347
348 data _null_;
349 do command = 'nslookup 207.255.105.92', 'nslookup 207.255.105.93';
350 eod = 0;
351 infile nslookup pipe filevar=command end=eod;
352 do until (eod);
353 input;
354 put command ':' _infile_;
355 end;
356 end;
357 stop;
358 run;
NOTE: The infile NSLOOKUP is:
Unnamed Pipe Access Device,
PROCESS=nslookup 207.255.105.92,RECFM=V,
LRECL=256
nslookup 207.255.105.92 :Server: spoke.dcn.davis.ca.us
nslookup 207.255.105.92 :Address: 168.150.253.2
nslookup 207.255.105.92 :
nslookup 207.255.105.92 :Name: 207-255-105-092-dhcp.unt.pa.atlanticbb.net
nslookup 207.255.105.92 :Address: 207.255.105.92
nslookup 207.255.105.92 :
NOTE: The infile NSLOOKUP is:
Unnamed Pipe Access Device,
PROCESS=nslookup 207.255.105.93,RECFM=V,
LRECL=256
nslookup 207.255.105.93 :Server: spoke.dcn.davis.ca.us
nslookup 207.255.105.93 :Address: 168.150.253.2
nslookup 207.255.105.93 :
nslookup 207.255.105.93 :Name: 207-255-105-093-dhcp.unt.pa.atlanticbb.net
nslookup 207.255.105.93 :Address: 207.255.105.93
nslookup 207.255.105.93 :
NOTE: 6 records were read from the infile NSLOOKUP.
The minimum record length was 0.
The maximum record length was 51.
NOTE: 6 records were read from the infile NSLOOKUP.
The minimum record length was 0.
The maximum record length was 51.
NOTE: DATA statement used (Total process time):
real time 0.75 seconds
cpu time 0.03 seconds

0 Comments:
Post a Comment
<< Home