08-30-2013 02:37 AM
ERROR:Name 'LCS_TBL_COURSE_ASSESSMENT_MATRIX_ASSOC' is too long for a SAS name in this context.
I get the following error. is there any solution/option to get rid of this error.
08-30-2013 04:02 AM
See: SAS(R) 9.3 Language Reference: Concepts, Second Edition (Names in the SAS Language) take attention for the cautions.
There is normally no need to violate the documented limitations, just need to know and/or find them
The long names are sometimes used in an external DBMS like MYSQL or used in the header of a column like excel.
The easiest approach would be to get aligned to all limitations on all involved tools. You have al lot of pitfalls in that.
For an external DBMS check those options as an example documented in the SAS/ACCESS specifics MYSQL.
SAS/ACCESS(R) 9.4 for Relational Databases: Reference, Second Edition (Naming Conventions for MySQL)
08-30-2013 07:35 AM
Venkatard, The limitations are well described (first link). Only SAS institute can change them, call it an enhancement request.
You did not describe the source of your problem, how you did run into that.
The solutions is making workarraounds on that:
- use a shorter name and the longer name as you wish as variable label (256)
- use a sas-metadata approach as there you can make notes to variables translations etc (information maps)
- define views in the external DBMS system as the second link suggested.
- Read columns headers as string and shorten those (Excel)
- ... (imagination)
Do not expect there will be ever an unlimited no-brainers approach.
Even using the short names can cause a lot of trouble as every tool is using its own reserved words.
Very nice if try to use a reserved into one of those. Will not work, fail terrible with not understandable errormessages.
You could use for instance a variable named "select" and try that using with SQL. Verry funny.
08-30-2013 08:43 AM
The problem is there are some 100 tables and i am making ETL in SAS Base.
This finally goes to tables with same lengths in MYSQL and goes into product.
So i cannot rename them as it will effect the final product.
Kust wondered will there be any short cut :-)
08-30-2013 01:16 PM
Using explicit pass-through should solve the problem of the "too long" table name on the DB side. For implicit pass-through (libname method), if you are querying a view you can get your DBA to shorten the name of the view.
08-30-2013 09:22 AM
venkatard, You mentioned the first time "MYSQL" it was a guess of me. Would be nice if I would have same results in a lottery.
In the mysql link the mentioned solution is defining views I suspect to have that done by the mysql dba admin.
With Explicit pass through you can also do a lot as you are coding the MYSQL syntax directly alls specifics and namings included.
I do not know whether it is supported by DI but you are coding in SAS Base/Foundation. You can do almost everything with that.
remember to code real Mysql code and not using the SAS specifics inside the execute block. SAS is not checking or doing anything with that.
The results can be SAS datasets with shorter names vice-versa.
SAS/ACCESS(R) 9.4 for Relational Databases: Reference, Second Edition (SQL Pass-Through Facility Specifics for MySQL)
SAS/ACCESS(R) 9.4 for Relational Databases: Reference, Second Edition (bulk loading mysql)