Date: Thu, 17 Apr 2008 11:32:16 -0500
Reply-To: Tom White <tw2@MAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Tom White <tw2@MAIL.COM>
Subject: Re: VERY EASY EXCEL question
Content-Type: text/plain; charset="iso-8859-1"
Arthur, code works fine for me after looking at character/numeric issue.
Thanks.
T
----- Original Message -----
From: "Arthur Tabachneck"
To: SAS-L@LISTSERV.UGA.EDU, "Tom White"
Subject: Re: VERY EASY EXCEL question
Date: Wed, 16 Apr 2008 18:18:27 -0400
Tom,
The code works perfectly on my machine with the one exception that Excel
doesn't display the first single quote. However, when I look at each of
the cells, the initial quote is definitely there.
One possible problem could be that your initial set of values for variable
A are characters rather than numbers.
If that is indeed the case, you would simply need to revise the compute
statements for B and C to NOT convert the numbers to text.
Art
----------
On Wed, 16 Apr 2008 16:21:08 -0500, Tom White wrote:
> Arthur,
>
> Thank you for this code.
>
> However, it dosn't seem to do what I need.
>
> The output for column B looks like
>
> '
>
> when it should look like, say,
> '123'
>
> or like, say, '123',
>
> which was my original question.
>
> T
>
> ----- Original Message -----
> From: "Arthur Tabachneck"
> To: SAS-L@LISTSERV.UGA.EDU, "Tom White"
> Subject: Re: VERY EASY EXCEL question
> Date: Wed, 16 Apr 2008 16:54:09 -0400
>
>
> Tom,
>
> Since you posted this on SAS-L, here is a SAS-based solution:
>
> PROC IMPORT OUT= WORK.have
> DATAFILE= "c\have.xls"
> DBMS=EXCEL2000 REPLACE;
> GETNAMES=YES;
> RUN;
>
> data want;
> set have;
> b=cats(input(put(a,5.),$8.),"'");
> c=cats(input(put(a,5.),$8.),",'");
> run;
>
> PROC EXPORT DATA= WORK.want
> OUTFILE= "c:\want.xls"
> DBMS=EXCEL2000 REPLACE;
> RUN;
>
> HTH,
> Art
> ---------
> On Wed, 16 Apr 2008 14:41:37 -0500, Tom White wrote:
>
>> SAS-L,
>>
>> I have an Excell sheet with one numeric column like:
>>
>> A
>> 123
>> 456
>> 789
>>
>> I would like to populate the next field over with
>>
>> B
>> '123'
>> '456'
>> '789'
>>
>>
>> If you can do the above, can you also do:
>> C
>> '123',
>> '456',
>> '789',
>>
>>
>>
>> I try to do:
>>
>>
>> =" 'A2' "
>>
>> but doesn't work.
>>
>> Thanks.
>>
>> t
>>
>> --
>> Want an e-mail address like mine?
>> Get a free e-mail account today at www.mail.com!
>
>
> --
> Want an e-mail address like mine?
> Get a free e-mail account today at www.mail.com!
--
Want an e-mail address like mine?
Get a free e-mail account today at www.mail.com!
|