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-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 746 views
  • 0 likes
  • 3 in conversation