Date: Sat, 28 Apr 2001 00:35:41 -0700
Reply-To: lend@IWON.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Len De La Cruz <lend@IWON.COM>
Subject: Re: Capturing File Data in UNIX
In-Reply-To: <OFB533EF55.D967887B-ON85256A3B.004872BC@bostonbio.com>
Content-Type: text/plain; charset="ISO-8859-1"
Hi,
You are absolutely right! I got it working before I got your
reply. I used Telnet instead of SAS Spawner.
Thank you so much for your help. Also, I would like to
thank the following: Jonathan Goldberg, Karsten Self and
others who responded to my query.
-- Original Message --
>
>That could explain the problem. You have to "PUT" the macro variable over
>to the remote host. To do this, you need to use %SYSLPUT. Have you used
>%SYSLPUT to copy the macro variable from the local host to the remote host?
>
>%SYSLPUT(remote-mac-varname, value or resolved-local-mac-var);
>
>For example,
>
>%SYSLPUT(THEFILE,&thefile); creates a macro variable called thefile on
>the
>remote host with the resolved value of the macro variable called thefile
>on
>the local host.
>
>Randy
>
>
>
>
>
> lend@iwon.com
>
> To: RChilds@bostonbio.com
>
> 04/26/2001 cc:
>
> 11:14 PM Subject: Re: Capturing File
>Data in UNIX
>
>
>
>
>
>
>
>
>Hi,
>
>Yes, I invoked the method in WEBAF using SAS connect.
>
>-- Original Message --
>
>>
>>Len,
>> I can't see any reason for this to not work. I wrote an AF SCL
>>program with only the submit continue block and it worked just fine.
>>
>> When you say that you are invoking the method "remotely", do you
mean
>>that you are invoking the method using SAS/CONNECT?
>>
>>Randy
>>
>>
>>
>>
>
>>
>> lend@iwon.com
>
>>
>> To: RChilds@bostonbio.com
>
>>
>> 04/26/2001 cc: "SAS-L "
><SAS-L@LISTSERV.UGA.EDU>
>>
>> 02:38 PM Subject: Re: Capturing File
>>Data in UNIX
>>
>
>>
>>
>
>>
>>
>>
>>
>>
>>Hi,
>>
>>I was able to make these codes work using interactive SAS.
>>This is giving me what I wanted but when I invoked
>>the method remotely, it does not work. Why?
>>
>>Here is the code:
>>
>> submit continue ;
>> %let thefile=/xxx/sas/data/usrexport/&workid./&deptid..csv;
>> filename ip PIPE "ls -al &thefile";
>> data two ;
>> length filedat $12.;
>> infile ip ;
>> INPUT @42 filedat $12. ;
>> put filedat ;
>> run;
>> endsubmit ;
>> dsid2=open('two');
>> rc=fetch(dsid2);
>> filedat=getvarc(dsid2,1);
>> rc=insertc(ret,"filedat",-1,filedat);
>> rc=close(dsid2);
>>
>>I could not see why it is not working.
>>
>>
>>-- Original Message --
>>
>>>Len,
>>> There are a couple of ways to fix your filename statement. The
>>>easiest solution is to simply not pipe the output of the ls command to
>>a
>>>file. Pass the output of the ls command to the cut command.
>>>
>>>filename test pipe 'ls -l /xxxx/sas/data/500080.csv | cut -c41-53';
>>>
>>> Otherwise, if there is a reason that you need to store that
>>>information in a file first, then use the following filename statement.
>>>You can use a semi-colon to separate UNIX commands.
>>>
>>>filename test pipe 'ls -l /xxxx/sas/data/500080.csv > temp ; cut -c41-53
>>>temp';
>>>
>>>Hope this helps.
>>>
>>>Randy Childs
>>>Senior Statistical Programmer
>>>Boston Biostatistics, Inc.
>>>
>>>------------------------------
>>>Date: Thu, 26 Apr 2001 05:14:56 -0700
>>>From: Len De La Cruz <lend@IWON.COM>
>>>Subject: Capturing File Data in UNIX
>>>
>>>Hi all,
>>>
>>>I am trying to capture the file date creation using this syntax :
>>>
>>>filename test pipe 'ls -l /xxxx/sas/data/500080.csv >| temp' | 'cut
>>-c41-53
>>>temp' ;
>>>
>>>What could be wrong?
>>>
>>>Thanks.
>>>
>>>
>>>
>>>Introducing iWon Cash Points...now everyone's a winner on iWon.com.
>>>Visit http://www.iwon.com now and start earning iWon Cash Points today!
>>>
>>>
>>
>>
>>
>>
>>Introducing iWon Cash Points...now everyone's a winner on iWon.com.
>>Visit http://www.iwon.com now and start earning iWon Cash Points today!
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
>Introducing iWon Cash Points...now everyone's a winner on iWon.com.
>Visit http://www.iwon.com now and start earning iWon Cash Points today!
>
>
>
>
>
>
>
Introducing iWon Cash Points...now everyone's a winner on iWon.com.
Visit http://www.iwon.com now and start earning iWon Cash Points today!
|