BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rmacarthur
Pyrite | Level 9

Hi,

I am trying to open an .xpt file in SAS Studio, without much luck,

 

Here is the code, which I copied from an earlier SAS community string:

 

libname target    "&tabin.";
filename importin "&tabin./substatxpt.xpt";

proc cimport infile=importin library=target;
run;

 

 

I receive the following error message:

 

NOTE 18-208: Libref TARGET was successfully assigned as follows:

Engine: V9
Physical Name: /home/director1/ABC/Data_170328\
63 filename importin "/home/director1/ABC/Data_170328/substatxpt.xpt" ;
64 proc cimport infile=importin library=target;
65 run;
 
NOTE 17-319: PROC CIMPORT begins to create/update data set TARGET.SUBSTAT
ERROR 9-7: File TARGET.SUBSTAT.DATA does not exist.
ERROR 96-319: Data set TARGET.SUBSTAT was not created/replaced due to errors.
NOTE: PROCEDURE CIMPORT used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 187.31k
OS Memory 59208.00k
Timestamp 04/05/2017 09:53:35 PM
Step Count 13775 Switch Count 28
Page Faults 0
Page Reclaims 9
Page Swaps 0
Voluntary Context Switches 63
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
My only thought is that the SAS XPT file does not contain data, or something along those lines.
Appreciate any insight you can provide, thanks,
R

 

1 ACCEPTED SOLUTION

Accepted Solutions
rmacarthur
Pyrite | Level 9

Thank you.

 

The .xpt file is 22kb

 

Here is the text I get when opening in notepad, I guess it speaks for itself !  , and file is corrupt ....

 

⨪佃偍䕒卓䑅⨪⨠䌪䵏剐卅䕓⩄‪⨪佃偍䕒卓䑅⨪⨠䌪䵏剐卅䕓⩄‪⨪佃偍䕒卓䑅⨪⨪⨪⨪䥌⁂佃呎佒⁌㍗弲倷佒ڼ匠十⸹밴䦃ꖼ㥄㄰問뱔厃䉕呓呁鞼䍖㈱膼䍒㜱백劇ㅌ㈵螼백厇〠†‰〠†低蒼배ㆉ閼汷ㅴ誼캼캼偓乁䌠乏剔䱏ⴠ밷㒂배ㆅ蚼〴誼뱌㒈배벎밦厦䅐⁎佃呎佒⁌

 

 

Also I did try the xport engine, and that did not work too.

 

Thank you !

View solution in original post

3 REPLIES 3
ballardw
Super User

What is the file size as reported by the operating system for that file?

 

Can you open the xpt file in a text editor? If so you would see some text similar to this on the first row if it was created by Proc Cport likey following COMPRESSED*****

LIB CONTROL W32_VSPR¼SAS  SAS9.2¼«D901SASHELP CLASS

so you could find the SAS version and the original name of the data set.

 

If it doesn't look like this then you are likely to have a corrupted file.

 

Another option may be to look at the xport engine:

 

filename importin xport "&tabin./substatxpt.xpt";

proc copy in=importin library=target;
run;
rmacarthur
Pyrite | Level 9

Thank you.

 

The .xpt file is 22kb

 

Here is the text I get when opening in notepad, I guess it speaks for itself !  , and file is corrupt ....

 

⨪佃偍䕒卓䑅⨪⨠䌪䵏剐卅䕓⩄‪⨪佃偍䕒卓䑅⨪⨠䌪䵏剐卅䕓⩄‪⨪佃偍䕒卓䑅⨪⨪⨪⨪䥌⁂佃呎佒⁌㍗弲倷佒ڼ匠十⸹밴䦃ꖼ㥄㄰問뱔厃䉕呓呁鞼䍖㈱膼䍒㜱백劇ㅌ㈵螼백厇〠†‰〠†低蒼배ㆉ閼汷ㅴ誼캼캼偓乁䌠乏剔䱏ⴠ밷㒂배ㆅ蚼〴誼뱌㒈배벎밦厦䅐⁎佃呎佒⁌

 

 

Also I did try the xport engine, and that did not work too.

 

Thank you !

rmacarthur
Pyrite | Level 9

So I just replaced the SAS studio file a newly downloaded  "original", and the code works...

Thanks ! 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 3585 views
  • 0 likes
  • 2 in conversation