| Date: | Thu, 28 Apr 2005 21:00:57 GMT |
| Reply-To: | Rusty Shackleford <rs@NATCHIE.MINE.NU> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Rusty Shackleford <rs@NATCHIE.MINE.NU> |
| Organization: | Debian GNU/Linux site |
| Subject: | Re: Filename PIPE and Datastep DOW loop |
|
Wow -- this is the most unusual use of SAS I've seen. Why not use a
language like C that has networking libraries available?
On Thu 28 Apr 2005 02:56:26 PM EDT, Matt Pettis wrote:
> 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
|