| Date: | Sun, 14 Apr 2002 08:40:08 +0200 |
| Reply-To: | Andreas Grueninger <grueninger@IBGRUENINGER.DE> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Andreas Grueninger <grueninger@IBGRUENINGER.DE> |
| Organization: | T-Online |
| Subject: | Re: Handling the $ in an ODBC libref to an Excel file. |
| Content-Type: | text/plain; charset=ISO-8859-1 |
Is is there because we use the ODBC engine of SAS/ACCESS in this example.
Excel files can be used with:
- SAS/ACCESS for PC File Formats
- SAS/ACCESS for Relational Databases
- SAS/ACCESS for OLE DB
The construct test.'Sheet1$'n is a feature of SAS available since long
variable names are available (version 7.*). In combination with OPTIONS
VALIDVARNAMES=any it allows you to use any name for tables, views and
variables including embedded space, special characters etc.
"Karl K." <karlstudboy@hotmail.com> schrieb im Newsbeitrag
news:q41u8.16696$3L2.1396573@bin7.nnrp.aus1.giganews.com...
> Pardon me for jumping in, but I coincidentally was pointing out this
obscure
> piece of SAS arcania to a staff member yesterday and just happen to have
the
> reference in front of me.
>
> It's in the "SAS/ACCESS Software for Relational Databases: Reference" in
the
> online doc. There's a chapter entitled "SAS Names and Support for DBMS
> Names". Scroll on down a screen or 2 in the Introduction and you'll see a
> section titled "SAS Name Literals" which describes the "'name'n"
> construction.
>
> Now don't ask me why it's in "SAS/ACCESS for Relational Databases" and NOT
> in "SAS/ACCESS for PC File Formats". . .
>
> "FMAINVILLE" <fmr@magma.ca.nospam> wrote in message
> news:1y%t8.43687$jD4.1392636@weber.videotron.net...
> > Thanks to Sander & Grueninger for their reply ! It works.
> >
> > May I now ask what does the n stand for ? see below :
> > test.'Sheet1$'n
> > As my searches through the SAS documentation provided no
> > clear answer to my question...
> >
> > F. Mainville
> > Statistics Canada
> >
> >
> > "Andreas Grueninger" <grueninger@ibgrueninger.de> wrote in message
> > news:a98h29$kff$06$1@news.t-online.com...
> > > I don't know how to get rid of this ugly (it is the internal name)
name.
> > > But here an example how to get a SAS table from an excel file.
> > >
> > > * --- use here your method to get a libname for the excel file ;
> > > %getODBCLibref (DBMS=MSEXCEL,libref=test,DBQ=c:\temp\test.xls);
> > > OPTIONS VALIDVARNAME=any;
> > > DATA sheet1;
> > > SET test.'sheet1$'n;
> > > RUN;
> > > LIBNAME test CLEAR;
> > > OPTIONS VALIDVARNAME=V7;
> > >
> > > "FMAINVILLE" <fmr@magma.ca.nospam> schrieb im Newsbeitrag
> > > news:zTIt8.25735$Hl2.877702@wagner.videotron.net...
> > > > Greetings to all,
> > > >
> > > > In defining an ODBC Libref to Excel, the dataset name get
represented
> as
> > > > Sheet1$
> > > > I have spent the day toying with the various quoting functions with
> out
> > > > success...
> > > > Converting to Ms Access solved the issue, but is there a way to
handle
> > the
> > > $
> > > > ?
> > > >
> > > > For example, in the following code
> > > >
> > > > Proc sql;
> > > > select * from mylib.sheet1$ ;
> > > > quit;
> > > >
> > > > SAS will complain about the $.
> > > > Any way of fixing this ?
> > > >
> > > > Thanks in advance,
> > > > F. Mainville
> > > > Statistics Canada
> > > >
> > >
> > >
> >
> >
>
>
|