06-22-2015 02:42 PM
I have a SQL server field that is 4000 characters long but when the library is created the SAS column is defaulted to 1024. If i edit the SAS table in the meta data and change it to 4000 it still seems to be truncating the data. Im sure there is a small change to make this occur but i am lost on how to implement it.
06-23-2015 02:51 AM
If it's the libname engine that truncates the field, it doesn't matter what you register in metadata. A PROC CONTENTS reveals how the libname maps the column.
Exactly what datatype do you have in SQL Server? Are you using OLEDB or ODBC?
06-23-2015 03:19 AM
If you connect via ODBC, you will have a limitation there.
06-24-2015 01:34 AM
The most stable method to extract data from a database (and which we use exclusively) is to unload from the DB into a flat file and read that with a simple data step.
No installation and maintenance of DB clients or ODBC interfaces, files can be transferred across any network topology, and no installing/licensing of SAS modules.
06-23-2015 03:46 AM
You need to set the DBMAX_TEXT= option. The default value is 1024.
You can do this on a LIBNAME statement or CONNECTION statement that connects to your database:
06-23-2015 04:36 AM
Others have already pointed you to DBMAX_TEXT.
"If i edit the SAS table in the meta data and change it to 4000 it still seems to be truncating the data."
Once the physical table has been created changing SAS Metadata won't help. Delete the physical SAS table and make sure that in your code the SAS Metadata definition is used to create the table - the re-run the code. Now the physical table should be in synch with your Metadata.