| Date: | Tue, 21 Jun 2005 00:37:25 -0400 |
| Reply-To: | Arthur Tabachneck <art297@NETSCAPE.NET> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Arthur Tabachneck <art297@NETSCAPE.NET> |
| Subject: | Re: label truncating |
|
Howard and Dave,
I was able to replicate Dave's situation as follows:
an excel spreadsheet with three rows and two variables:
long label line one even longer yet label line two but with even more
verbage to make it longer
1 a
2 b
Imported with the following Proc Import:
PROC IMPORT OUT= WORK.one
DATAFILE= "C:\test5.xls"
DBMS=EXCEL REPLACE;
GETNAMES=YES;
MIXED=YES;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;
RUN;
And seeing the following by running Proc Contents:
# Variable Type Len Format Informat Label
2 even_longer_yet_ Char 1 $1. $1. even longer yet label
line two but
label_line_two_b with even more
verbage to mak
1 long_label_line_one Num 8 long label line one
Interestingly, the label is truncated at the 50th character.
David, while I'm sure the following is not the 'optimal' solution, it will
work:
PROC IMPORT OUT= WORK.one
DATAFILE= "C:\test5.xls"
DBMS=EXCEL REPLACE;
range='a1:b1';
GETNAMES=NO;
MIXED=YES;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;
RUN;
data _null_;
set one;
call symput ("f1label",F1);
call symput ("f2label",F2);
run;
PROC IMPORT OUT= WORK.one
DATAFILE= "C:\test5.xls"
DBMS=EXCEL REPLACE;
GETNAMES=NO;
range='a2:c3';
GETNAMES=NO;
MIXED=YES;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;
RUN;
data one;
set one;
label f1="&f1label.";
label f2="&f2label.";
run;
proc contents data=one;
run;
which, according to Proc Contents, results in:
# Variable Type Len Format Informat Label
1 F1 Num 8 long label line one
2 F2 Char 1 $1. $1. even longer yet label line two but with
even more verbage
to make it longer and some
extra junk for good measure
Art
--------------
""Howard Schreier <hs AT dc-sug DOT org>"" <nospam@HOWLES.COM> wrote in
message news:200506210325.j5L3PpGH013005@listserv.cc.uga.edu...
> Which of the available tools are you using to import?
>
> Is the truncation consistent in terms of the number of characters
> preserved? If so, what is the number?
>
> Please show code and evidence.
>
> On Mon, 20 Jun 2005 12:48:57 -0700, David Fickbohm
<davefickbohm@YAHOO.COM>
> wrote:
>
> >People,
> >When I import an excel spreadsheet with long labels. The lables
> truncate. Is there a way to let the length of labels? or a way to stop
> the trucating?
|