BookmarkSubscribeRSS Feed
lbarwick
Quartz | Level 8

I have an existing SAS table that is produced from my company's SQL database. One of the fields contains each record's audit trail and I am trying to parse that field for reporting purposes. When I read the table into SAS the length, format, and informat are 2000 which is truncating some of the data contained in the field. I have tried changing the length, format, and informat as follows:

 

data want;

length audit $ 10000; informat audit $10000.; format audit $10000.;

set datain.have;

run;

 

But, the result is still a truncation at 2000 characters. I'm assuming there is nothing else I can do in SAS and need to contact the SQL DB admin to change the format of the field in the source data set.

 

Thoughts?

2 REPLIES 2
tomrvincent
Rhodochrosite | Level 12
read the database with explicit passthru SQL. It should create the text field with the appropriate length.
Tom
Super User Tom
Super User

If you are reading the data from a remote database check or change the setting for DBMAX_TEXT  option on the libname or connect statement.  SAS will normally truncate long character values to that maximum length before moving the data to SAS.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 691 views
  • 2 likes
  • 3 in conversation