Date: Thu, 17 Jan 2008 00:50:32 -0800
Reply-To: "JKamgang@Yahoo.com" <JBKamgang@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "JKamgang@Yahoo.com" <JBKamgang@GMAIL.COM>
Organization: http://groups.google.com
Subject: Re: How to access automatically in SAS a MS Access table name
Content-Type: text/plain; charset=ISO-8859-1
Dear Paul, Mary, Liu, & All,
Thank you for your assistance.
Yes, to solve this issue, I created a Ms Access Query with shorter
name, which was linked to the table.And then in the program I used the
query name instead of the table name. This works. Thank you once
again.
= = =
The query in Ms Access
Qry_Tbl_PatHIVResultAdd
---
SELECT tblInfantHIVTestResultsAdditional.studyid,
tblInfantHIVTestResultsAdditional.labid,
tblInfantHIVTestResultsAdditional.testid,
tblInfantHIVTestResultsAdditional.i2,
tblInfantHIVTestResultsAdditional.i2_da,
tblInfantHIVTestResultsAdditional.i2_mo,
tblInfantHIVTestResultsAdditional.i2_yr,
tblInfantHIVTestResultsAdditional.i2a,
tblInfantHIVTestResultsAdditional.i2b,
tblInfantHIVTestResultsAdditional.i2btxt
FROM tblInfantHIVTestResultsAdditional;
---
The final SAS Code and log:
---
1218 data pedResultadd ;
1219 set dbsource.Qry_Tbl_PatHIVResultAdd (keep =
1220
1221 testid studyid labid i2 i2_da i2_mo i2_yr i2a i2b i2btxt
1222 );
1223
1224 run;
NOTE: There were 235 observations read from the data set
DBSOURCE.Qry_Tbl_PatHIVResultAdd.
NOTE: The data set WORK.PEDRESULTADD has 235 observations and 10
variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
cpu time 0.03 seconds
---
Thank you all for supporting me.
May all have a nice day!
Bye!
Jean Baptiste,
On Jan 16, 9:26 pm, pcho...@DDS.CA.GOV ("Choate, Paul@DDS") wrote:
> Jean -
>
> Unfortunately you are stuck - SAS only allows dataset names up to 32
> bytes long - using name literals or conventional names. Defining
> short-named queries of your tables within MSAccess is a very good idea.
> The SAS libname engine will read the queries as tables and it doesn't
> necessitate changing your table names.
>
> Paul Choate
> DDS Data Extraction (916) 654-2160
>
>
>
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SA...@LISTSERV.UGA.EDU] On Behalf Of
>
> JKamg...@Yahoo.com
> Sent: Wednesday, January 16, 2008 9:32 AM
> To: SA...@LISTSERV.UGA.EDU
> Subject: How to access automatically in SAS a MS Access table name which
> has more than 32 characters?
>
> Dear All,
>
> Happy New Year ,
>
> Please, I need your help in figuring out how to access in SAS a MS
> Access
> table name which has more than 32 characters. As this program merges 5
> databases, I need to have almost everything automated. That's why I
> don't want to rename manually the table names.
>
> Please find the program below.
>
> Thanks in advance for your kind assistance,
>
> Jean Baptiste
>
> The program:
>
> - - -
>
> options VALIDVARNAME=ANY ;
>
> libname DBsource access 'S:\Data
> Management\External\Projects\MTCT-Plus\MTCT-Plus November 2007
> Data\Programs\Data\MTCT-PlusData All.mdb';
>
> /* Creating the Pediatric HIV result information additional */
>
> data* pedResultadd ;
>
> set dbsource.'tblInfantHIVTestResultsAdditional'n (keep =
>
> testid studyid labid i2 i2_da i2_mo i2_yr i2a i2b i2text
>
> );
> *
>
> run*;
>
> - - - The log - -
>
> 1636
>
> 1637 /* Creating the Pediatric HIV result information additional */
>
> 1638
>
> 1639 data pedResultadd ;
>
> 1640 set dbsource.'tblInfantHIVTestResultsAdditional'n (keep =
>
> ---------------------------------------------
>
> 211
>
> ERROR 211-185: Invalid data set name.
>
> 1641
>
> 1642 testid studyid labid i2 i2_da i2_mo i2_yr i2a i2b i2text
>
> 1643 );
>
> Jean Baptiste,
>
> ---
>
> Jean Baptiste KAMGANG,
>
> Lead Data Manager - CDC Cameroon
>
> US Centers for Disease Control and Prevention
>
> Mutengene, SouthWest Province Cameroon, Africa
>
> E mail: JBKamg...@cm.cdc.gov.
>
> Tel: + 237 3 335 1690
>
> Fax: + 237 3 335 1692
>
> Cell: + 237 9 984 79 14
>
> ---
>
> .- Hide quoted text -
>
> - Show quoted text -
|