BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Mishka1
Fluorite | Level 6

I'm trying to get data from an Access 2007 database. The field is text and can be 2000 characters long.

SAS is truncating the field to 1024 chars.

What is the correct way of importing this table so that the field length is preserved?

What I'm doing now is creating a libname using odbc to connect to the Access db.

When I "View Columns" in the table in Explorer window in SAS for the Access library, it shows the length of the field as 1024.

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Use the Access Engine as in :

libname ac Access "myDatabase.accdb" DBMAX_TEXT=2048;

from SAS doc:

DBMAX_TEXT= integer between 1 and 32,767

specifies the maximum length for a character string. Character strings longer than 32,767 are truncated. This option only applies when you are reading, appending, and updating character data in a Microsoft Access database or Microsoft Excel workbook from SAS.

Default:1,024

PG

PG

View solution in original post

2 REPLIES 2
PGStats
Opal | Level 21

Use the Access Engine as in :

libname ac Access "myDatabase.accdb" DBMAX_TEXT=2048;

from SAS doc:

DBMAX_TEXT= integer between 1 and 32,767

specifies the maximum length for a character string. Character strings longer than 32,767 are truncated. This option only applies when you are reading, appending, and updating character data in a Microsoft Access database or Microsoft Excel workbook from SAS.

Default:1,024

PG

PG
Mishka1
Fluorite | Level 6

Excellent. Thank you.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 2 replies
  • 1879 views
  • 0 likes
  • 2 in conversation