Date: Fri, 16 May 2008 14:59:41 -0400
Reply-To: "Howard Schreier <hs AT dc-sug DOT org>"
<schreier.junk.mail@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Howard Schreier <hs AT dc-sug DOT org>"
<schreier.junk.mail@GMAIL.COM>
Subject: Re: How to have SAS put out a string with blanks in single cells
in Excel
On Fri, 16 May 2008 14:37:42 -0400, Jake Bee <johbee@GMAIL.COM> wrote:
>Yes, Thanks, this works, sort of ... but not in my array example.
I tested with your code and it worked for me. What does your code now look
like, and exactly what are you getting?
>I had tried it earlier, but then posted when it failed with my array.
>
>Any other ideas appreciated.
>
>Thanks!
>
>Jake
>
>
>
>On 5/16/08, Howard Schreier <hs AT dc-sug DOT org> <
>schreier.junk.mail@gmail.com> wrote:
>>
>> On Thu, 15 May 2008 22:48:02 -0400, Jake Bee <johbee@GMAIL.COM> wrote:
>>
>> >Dear SAS-L:
>> >
>> >
>> >Is the a way to have SAS put out strings with spaces in single cells? I
>> >tried using '09'x and lrecl=6 in the code below.
>>
>> Close. Use the NOTAB option in the FILENAME statement. That will put
>> everything in one cell, so place the tab literal ('09'x) in the PUT
>> statement wherever you want to jump to the next column.
>>
>> >
>> >The code below creates 6 columns in excel. I only want 2 columns
>> >(regardless of the r1c6 endpoint). The 2 columns
>> >
>> >should have 'a b c' in c1 and 'l t jb' in c2. Can this be done in SAS to
>> >excel via DDE. Thanks for any information!
>> >
>> >
>> >Jake
>> >
>> >
>> >
>> >
>> >%let file_var1 =
>> >d:\bee\spreadsheets\[test.xls]sheet1!r1c1:r1c6;
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >filename out dde
>> >"excel|&file_var1";
>>
>> "excel|&file_var1" NOTAB ;
>>
>> >
>> >
>> >
>> >
>> >data
>> >a;
>> >
>> > length x1-x2
>> >$6;
>> >
>> > x1='a b
>> >c';
>> >
>> >
>> > x2='l t
>> >jb';
>> >
>> >run;
>> >
>> >
>> >
>> >
>> >data
>> >_null_;
>> >
>> >
>> > set
>> >a;
>> >
>> > array x(2)
>> >
>> >
>> > x1 -
>> >x2;
>> >
>> > file out;
>> >
>> >
>> > do i = 1 to
>> >2;
>> >
>> > put x(i)@;
>>
>> put x(i) '09'X @;
>>
>> >
>> >
>> > end;
>> >
>> >
>> >
>> >put;
>> >
>> >
>> >run;
>>
|