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

 

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
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-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
  • 531 views
  • 0 likes
  • 4 in conversation