BookmarkSubscribeRSS Feed
sn_1
Calcite | Level 5

Hello,

 

Can you please suggest if there is a way to convert UTF-8 encoded XPT file into SAS dataset in WLATIN1 SAS 9.4 environment. I have tried many options like ENCODING=ANY . But nothing worked. I encountered below log issue.

 

sn_1_0-1714506947595.png

 

I understand UTF-8 is a  MBCS where as WALTIN1 is Single Byte Character Set (SBCS). I understand we can change the configuration to UTF-8 to use MBCS data. But is there a way to do this without changing the environment of SAS to read into file.

 

Thank you much!

Swathi

3 REPLIES 3
Ksharp
Super User
You could use UNICODE sas to import this kind of XPT , after that just convert this dataset from utf-8 encoding into WALTIN1 encoding by this URL:

https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/nlsref/p1g1d26os4w0von1cdfh827foo3r.htm
Tom
Super User Tom
Super User

It matters a lot what type of file your "XPT" file is.  The XPT extension has no fixed definition.  SAS can create V5 XPORT files using the XPORT libref engine.  It can make CPORT files using PROC CPORT.  You can even now make a modified/enhanced version of the XPORT file format that supports V7/V8/V9 enhancements to the SAS dataset by using the SAS supplied %LOC2XPT() macro.

 

So what type of file do you have?  If you don't know you can use this macro to test your file:

https://github.com/sasutils/macros/blob/master/xpttype.sas

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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