BookmarkSubscribeRSS Feed
Jhonarsalina
Calcite | Level 5

Hello,

Requesting your help again.

I am taking a table from sql server to SAS Viya.

In that table there is a variable of length greater than 1024.

 

I use the following code to copy the table:

 

  DATA survey08;
	length RESPONSEDIAN_DESC $ 2000;
  set ANALYTIC.VC_RESPONSEDIAN ;
	 inFORMAT RESPONSEDIAN_DESC $2000. ;
	 FORMAT RESPONSEDIAN_DESC $2000. ;
  RUN;

Show the following warning;

WARNING: During read: [SAS][ODBC SQL Server Wire Protocol driver]String data, right truncated.

En la tabla resultado me presenta lo siguiente:

Jhonarsalina_0-1654707417239.png

I would like to know how to see more characters in this view.

 

Beforehand thank you very much

 

Cheers

 

Jhonar Salina

 

 

4 REPLIES 4
ballardw
Super User

Exactly how long is the variable in the external data source?

If it is longer than 2000 then you may have truncated the values by limiting them to 2000 characters with the Length statement.

 

I am not familiar with the "SQL Server Wire Protocol driver" so do not know if you may also need to make configuration changes to the driver to allow longer values to pass or if it is possible.

Jhonarsalina
Calcite | Level 5

I was checking and it brings all the information but it does not show it in the table.

It is displaying 1024 characters max.

Do you know of a way to show more?

Tom
Super User Tom
Super User

Are you saying that the whole value is the SAS dataset, but whatever tool you used to look at the data that led to the photograph you posted has truncated the data?

Did you try looking at it in some other way?

 

What if you just show some of the values to the log?

For example this will break the first value it finds that is longer than 1000 bytes into chucks of 100 bytes and dump them to the SAS log.

DATA _null_;
  length RESPONSEDIAN_DESC $ 2000;
  set ANALYTIC.VC_RESPONSEDIAN ;
  where length(RESPONSEDIAN_DESC) > 1000;
  do i=0 to length(RESPONSEDIAN_DESC) by 100;
     string=substrn(RESPONSEDIAN_DESC,i,100) ;
     put string $char100.;
   end;
   stop;
run;
Jhonarsalina
Calcite | Level 5

I've already managed to see all the information in the column. I added the option DBMAX_TEXT= at the moment of connecting to SqlServer:

libname analytic sqlsvr dsn="SQL Server Wire Protocol" user="Admin" password="3DAPass" schema=dbo DBMAX_TEXT=12000;

 

Thank you very much.

 

Cheers

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
  • 4 replies
  • 450 views
  • 0 likes
  • 3 in conversation