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

I use SAS PC Connect to extract a large database from the WRDS server using PROC DOWNLOAD. In the process, I kept getting warning messages "an error occurred translating a data set variable's value". This really bothers me, since the downloading takes 20+ hours. Why do we have these messages, and is there a good solution?

1 ACCEPTED SOLUTION

Accepted Solutions
sbxkoenk
SAS Super FREQ

Hello @xyxu ,

 

Maybe your "problem" is related to this Cross-Architecture Issue :

 

SAS® 9.4 and SAS® Viya® 3.5 Programming Documentation
SAS/CONNECT
Encoding Compatibility between SAS/CONNECT Client and Server Sessions
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/connref/n1smv71b6303yen17kx46uxc0nxh.htm

UTF-8 versus WLATIN1 for example.


You can do a PROC CONTENTS on the Wharton data set to find out about its encoding!

 

Good luck,

Koen

View solution in original post

5 REPLIES 5
sbxkoenk
SAS Super FREQ

Hello @xyxu ,

 

Maybe your "problem" is related to this Cross-Architecture Issue :

 

SAS® 9.4 and SAS® Viya® 3.5 Programming Documentation
SAS/CONNECT
Encoding Compatibility between SAS/CONNECT Client and Server Sessions
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/connref/n1smv71b6303yen17kx46uxc0nxh.htm

UTF-8 versus WLATIN1 for example.


You can do a PROC CONTENTS on the Wharton data set to find out about its encoding!

 

Good luck,

Koen

xyxu
Quartz | Level 8
I used proc contents to check the encoding of my target dataset on WRDS. The encoding is utf-8 Unicode (UTF-8). How do I make sure that it is compatible?
sbxkoenk
SAS Super FREQ

Hello,

 

I am afraid you have to set the encoding of your local SAS session to UTF-8 as well.

Look in the documentation for :

"Setting the Encoding of a SAS Session".

 

Although you can also try to add some data set options to the datasets in proc download. Not sure if that will work. Maybe worthwhile to check this first !!
Something like :

select sales(outrep=);
select sales(encoding=);

 

I guess your (Windows?) local SAS session is in WLATIN1.

And I suppose you want to stick to WLATIN1.

 

That's no problem. 
If you start your Windows SAS session again with WLATIN1 , you will be able to work with the Wharton UTF-8 dataset thanks to CEDA (Cross Environment Data Access).
But it's more efficient to change the encoding of the data set.

This is how that can de done :

LIBNAME inlib cvp 'SAS-library';
LIBNAME outlib 'SAS-library' outencoding=”encoding value for output”;
proc copy noclone in=inlib out=outlib;
   select car;
run;

 

 

Koen

xyxu
Quartz | Level 8

Here is how I did it. Might be useful to others. I used 

proc options option=encoding; run;

to find my current encoding. It was indeed WLATIN1. Then I followed the instructions here to change the encoding of my local SAS session to UTF-8. The "problem" disappeared!

 

 

ChrisNZ
Tourmaline | Level 20

If your local encoding is wlatin, this character set has no means to represent or store all the characters available in UTF8.

The only way to keep all the source UTF8 characters is to save your data in a UTF8 SAS data set.

To do this, you should run your SAS session as a UFT8 session. This change can only be made in the configuration file that's read when SAS starts.

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 5 replies
  • 774 views
  • 3 likes
  • 3 in conversation