BookmarkSubscribeRSS Feed
venkatard
Calcite | Level 5

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.

8 REPLIES 8
Fugue
Quartz | Level 8

Try shortening the name so that it is less than 32 characters.

venkatard
Calcite | Level 5

Cannot do as i am extracting these tables from MYSQL DB.

jakarman
Barite | Level 11

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)

---->-- ja karman --<-----
venkatard
Calcite | Level 5

That means there is no solution for this?

jakarman
Barite | Level 11

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.

---->-- ja karman --<-----
venkatard
Calcite | Level 5

Sorry Jaap,

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 🙂

Fugue
Quartz | Level 8

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.

jakarman
Barite | Level 11

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.

MySQL :: MySQL 5.0 Reference Manual :: 13.1.12 CREATE VIEW Syntax

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.

see:

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)

---->-- ja karman --<-----

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 3779 views
  • 0 likes
  • 3 in conversation