SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
mounikag
Obsidian | Level 7

Hi All,

 

I have a XPt file where iam trying to convert them into sas datasets by using below code but it throwing an error in SAS log. Could you please provide your thoughts on this.

 

libname in xport "C:Desktop\SAS1\data.xpt";
proc copy inlib=in outlib=work;
run;
proc cimport library=work infile="C:Desktop\SAS1\data.xpt";
run;

 

SAS LOG ERROR:

ERROR: The transport file was created in the encoding utf-8. This session encoding, wlatin1, can read and create transport files
in the encoding, wlatin1. Data not imported.

 

Thanks,

Mounika

7 REPLIES 7
ChrisNZ
Tourmaline | Level 20

The message is pretty clear. You might have unicode characters in the data sets, which your current SAS session cannot read because it uses encoding wlatin1

SAS your SAS session with encoding UTF-8 to read these tables. Either:

  1. At SAS invocation add the option, -encoding utf-8.
  2. Add the system option to the SAS configuration file, ENCODING=UTF-8.
 
mounikag
Obsidian | Level 7
HI Chrisnz,

Thanks for the reply and I tried using ENCODING=UTF-8 but it didnt worked
mounikag
Obsidian | Level 7
Thanks for the reply. I tried using your method by opening with SAS 9.4 unicode and tried running the above program but its throwing an error as below:

WARNING: No data is available.

Please suggest on this
ChrisNZ
Tourmaline | Level 20
Please suggest on this

Please show us the full log report.

ChrisNZ
Tourmaline | Level 20

@Ksharp wrote:

Ksharp_0-1629205498686.png

 


Some lucky souls still have SAS on their desktop rather than the dreadful EG? So jealous!

mounikag
Obsidian | Level 7

Thanks Chrisnz and Ksharp for your time to answer my question .

Issue got resolved with autocall macro called 

  • %XPT2LOC
    : It createdv SAS datasets
  •  

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 7 replies
  • 1634 views
  • 3 likes
  • 3 in conversation