Date: Fri, 6 Aug 2010 15:39:45 -0400
Reply-To: Tom Abernathy <tom.abernathy@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Tom Abernathy <tom.abernathy@GMAIL.COM>
Subject: Re: SAS INFILEing a perl program using a PIPE
Kevin -
As the FILE and the INFILE do not look related from reading your SAS code
why not try placing the INFILE statement before the FILE statement. Perhaps
this will make SAS less confused?
But I am not sure what purpose your FILE/PUT statements are doing? Are
you trying to pass the filename in the PUT statement to the actual PERL
program? If so they why not just pipe it into the PERL program?
If you want to pipe in the content of the file then use:
filename abi_seq pipe "perl c:\perl\program\abi_seq.ps < c:\a19.ab1";
If you want to pipe in just the filename then use:
filename abi_seq pipe "echo c:\a19.ab1 | perl c:\perl\program\abi_seq.ps";
- Tom Abernathy
On Fri, 6 Aug 2010 19:14:36 +0000, toby dunn <tobydunn@HOTMAIL.COM> wrote:
>Me wonders if there isnt a problem with SAS and Perl both using the stdin
and stdout. Sounds like a Rick Langston type of question.
>
>Toby Dunn
>>
>> Tom,
>>
>> The problem is even simpler than that and rears if I use only one FILE
destination and one INFILE source:
>>
>> 2580 FileName ABI_Seq pipe "perl C:\Perl\Programs\ABI_Seq.ps" ;
>> 2581
>> 2582 Data _null_ ;
>> 2583
>> 2584 __AB1 = "C:\A19.ab1" ;
>> 2585
>> 2586 File "C:\ABI_path.txt" ;
>> 2587 Put __AB1 ;
>> 2588 File Log ;
>> 2589
>> 2590 Length __Amplicon_Poly $ 5000 ;
>> 2591
>> 2592 Infile ABI_Seq ;
>>
>>
>> Note that on line 2586 I attempt to write to a text file (successfully),
but then perl program (line 2592) fails. If I comment out line 2586, then
the perl program works as intended.
>>
>> I had been doing that in TWO different datasteps within a macro file-by-
file.
>>
>> -Kevin
>>
>> Kevin Viel, PhD