SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
zenenceladus
Fluorite | Level 6

Do to our installation we are forced to import files from our desktop using the import GUI in SAS VIYA> When I try to import am xpt file I get an error message that the file type is unsupported. I have no problem importing the same xpt files into JMP. 

zenenceladus_0-1650649684445.png

 

4 REPLIES 4
ChrisHemedinger
Community Manager

I don't think you want to use the Import function. XPT files are read using a SAS library engine (XPORT), so the approach would be to upload the XPT files you need and then use code to assign a libname to each file.

 

Example code:

libname data xport "&_userhome/XPT/class.xpt";
proc contents data=data.class; quit;

 

xport-viya.png

 

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!
emilykennewell
Calcite | Level 5

proc contents data=data.class; quit;: This code block is using the proc contents procedure to display information about the contents of the specified dataset. In this case, it's the "class" dataset within the "data" library. This helps you understand the structure of the dataset, such as variable names, types, and formats.

If you have multiple XPT files, you can repeat the libname statement for each file and then use the appropriate dataset names in subsequent SAS procedures.

Ensure that the path to your XPT file is correct, and replace "&_userhome/XPT/class.xpt" with the actual path to your XPT file.

Tom
Super User Tom
Super User

The extension XPT has no fixed meaning.  So it MIGHT be a file in the SAS V5 Transport format that can be read with the XPORT library engine.  But it might be a file created with PROC CPORT that would require using PROC CIMPORT to read.  Or it might be a SAS V7/8/9 Transport file create by the %LOC2XPT() macro in which case you would need to use the %XPT2LOC() macro to read it.

 

I don't use JMP, but perhaps the information that it can be imported by JMP would tell someone that is familiar with JMP what type of file it is. 

Tom
Super User Tom
Super User

If the file is not accessible on the machine where SAS (whatever flavor) is running then you need to get the file there first.

So if your site has totally disabled your ability to upload a file then they need to provide some other method for you put the file where SAS can access it.

The IMPORT wizard is not the tool for working with XPT files.  It might be in JMP since that is foreign file structure to JMP.

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!

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
  • 4 replies
  • 1160 views
  • 0 likes
  • 4 in conversation