|
|||
|
data aidsdb.'8-2007'n;
just guessing. On 10/8/07, Jack Clark <JClark@chpdm.umbc.edu> wrote: > > > Hello, > > > > As a side project, I have been revising our center's production SAS > programs to replace the DBLOAD procedure with data step logic (using > LIBNAME with the ODBC parameter). We had been using DBLOAD to move data > processed with SAS over to SQL Server databases. The new approach has > been relatively easy to implement and has dramatically decreased > transfer times. Below is an example of how we move a SAS dataset HAVE > to a SQL Server table TREATMENT in the AIDS database. > > > > > > libname aidsdb odbc noprompt="dsn=aids;" bulkload=yes; > > > > proc sql; > > drop table aidsdb.treatment > > ; > > quit; > > > > > > data aidsdb.treatment; > > set have; > > run; > > > > > > The problem I ran into this morning is that some of the SQL Server > tables have names that start with a number. For example, there are a > set of monthly tables with a naming convention of MM-YYYY (8-2007, > 9-2007, 10-2007, 11-2007, etc.). I know that SAS data set names can not > start with a number, and when I use the following code, I get an error > (the actual production code is a macro program with &dsname holding the > SQL Server table name). > > > > data aidsdb.8-2007; > > set have; > > run; > > > > > > NOTE: Line generated by the macro variable "DSNAME". > > 1 aidsdb.8-2007 > > - > > 22 > > 76 > > > > ERROR 22-322: Expecting a name. > > > > ERROR 76-322: Syntax error, statement will be ignored. > > > > > > I know I am asking for the best of both worlds. I want to be able to > use the data step to create/write to SQL Server tables, but without the > limitations of SAS data set names (since I am not really creating a SAS > data set). Any suggestions? Has anyone else had to work around this > issue? > > > > Suggestions to change the names of the SQL Server tables to valid SAS > names are expected, but I wanted to know if I can work with what I have > before trying to modify several table names which would have an impact > on the programming logic within the web applications that use the SQL > Server tables. > > > > Thank you. > > > > Jack Clark > > Research Analyst > > Center for Health Program Development and Management > > University of Maryland, Baltimore County > > > > > |
|
|
||||
|
||||
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Question on proc sql | Anindya Mozumdar | Newsgroup comp.soft-sys.sas | 0 | 06-15-2008 02:24 PM |
| Re: Question about efficient data extraction | Bucher Scott | Newsgroup comp.soft-sys.sas | 0 | 06-04-2008 07:41 PM |
| Re: Data types going to SQL Server | Ed Heaton | Newsgroup comp.soft-sys.sas | 0 | 01-03-2008 07:51 PM |
| Re: SAS-L Digest - 5 Oct 2007 - Special issue (#2007-1685) | Hanas, Melissa L. | Newsgroup comp.soft-sys.sas | 0 | 10-05-2007 05:57 PM |
| Re: Synchronizing the data in sql server to sas dataset | David L Cassell | Newsgroup comp.soft-sys.sas | 0 | 01-09-2007 05:25 AM |