BookmarkSubscribeRSS Feed
Sandyz
Fluorite | Level 6

Hi All,

 

I have requirement to find the encoding type of a .xpt file, if i use libname+xport engine i am getting encoding type as"Default" but thats not the actual encoding.

 

If i use libname+xport engine+proc copy getting the encoding type of sas environment, means irrespective filetype, getting default sas encoding type.(i.e. UTF-8).

 

Please let me know, is there any way or X commands to find the encoding type.

4 REPLIES 4
paulkaefer
Lapis Lazuli | Level 10

X commands are UNIX commands, so according to this StackOverflow post,

file -bi <file name>

should do the trick.

 

This page says you can specify encoding="utf-8" when creating the set.

 

This page says you can determine encoding from within SAS by right-clicking and selecting properties.

Sandyz
Fluorite | Level 6

Hi  paulkaefer,

 

Thaks for your reply, i tried unix command in sas session howevr it's not working. Can you tell me any other way to do it.

 

 

Thanks,

Sandeep

paulkaefer
Lapis Lazuli | Level 10

The first thing to check is, are you actually running on a Linux/UNIX environment? If so, what is the log saying? It's difficult to diagnose the problem just based on you saying it's not working for you. Is there a chance it's looking in the wrong directory? Perhaps there is a problem with the command or program logic.

 

If you are running on Windows, you'll probably have a problem. The X statement will still work under Windows, but the file command is not available by default. You could install coreutils or Cygwin to get it on Windows.

 

XunjieLi
Calcite | Level 5

Dear,

 

Would you please let me know if you've figured out the question about the xpt encoding?

 

Looking forward to the responses.

 

Regards,

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
  • 2932 views
  • 1 like
  • 3 in conversation