Yep, fun and games with long fields. I found it better to use pass-through sql than the libname statement. I download lots of tables using pass through SQL with the database dbmax_text=32767 option. I use global macro variables for the database log on information: &GLB_USER &GLB_PASSWORD &GLB_DBname &GLB_DSN_NAME &GLB_ServerIPaddr ** macro to pull all the data from the table ; %macro SQLPullDataBig (outputdataset,SQLtableName,DatasetLabel); PROC SQL; CONNECT TO ODBC AS ODBCref (NOPROMPT="UID=&GLB_USER;PSW=&GLB_PASSWORD;DSN=&GLB_DSN_NAME; SERVER=&GLB_ServerIPaddr;DATABASE=&GLB_DBname" dbmax_text=32767); Create table &outputdataset(compress=binary label="&DatasetLabel") as Select * from connection to ODBCref ( Select * From &SQLtableName ); quit; %mend; %SQLPullDataBig(libName.outputDatasetName,SQLtableName,Label for you dataset); Now when the fields are longer than 32,767 characters life get more interesting as the only way seems to be to chop the field up and download from SQL in sections. I have SAS code which does this by working out the maximum length of the field and generating the download code as required. If anyone is interested.
... View more