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

Hello, new to SAS. Can anyone help me out? I'm trying to import an XPT file into my Work Library. I keep getting errors and I'm not either being able to understand other posts or my issue doesn't seem to be addressed. In short, I'm frustrated. I tried the following code:

 

libname a '/sasem/sasworks/SAS_workxxxxxxa/SAS_workxxxxxxa/Work';
libname xptfile xport "C:\Users\xxxxx\Documents\Work\Documentations - xxxxxxxxxx\[filename].xpt" access=readonly;
proc copy inlib=xptfile outlib=a;
run;

And I get the following error (I put xxxxx's to shorten the paths):

1                                                          The SAS System                               12:04 Monday, April 22, 2019

1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET _CLIENTTASKLABEL='Program';
4          %LET _CLIENTPROCESSFLOWNAME='Process Flow';
5          %LET _CLIENTPROJECTPATH='';
6          %LET _CLIENTPROJECTPATHHOST='';
7          %LET _CLIENTPROJECTNAME='';
8          %LET _SASPROGRAMFILE='';
9          %LET _SASPROGRAMFILEHOST='';
10         
11         ODS _ALL_ CLOSE;
12         OPTIONS DEV=PNG;
13         GOPTIONS XPIXELS=0 YPIXELS=0;
14         FILENAME EGSR TEMP;
15         ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR
16             STYLE=HtmlBlue
19             NOGFOOTNOTE
20             GPATH=&sasworklocation
21             ENCODING=UTF8
22             options(rolap="on")
23         ;
NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
24         
25         GOPTIONS ACCESSIBLE;
26         libname a '/sasem/sasworks/SAS_xxxxxxxx/SAS_xxxxxxxx/Work';
NOTE: Library A does not exist.
27         libname xptfile xport "/sasem/sasdir/config/Lev1/SASApp/C:\Users\xxxxxxx\Documents\Work\Documentations - xxxxxxx\[filename].xpt" access=readonly;
NOTE: Libref XPTFILE was successfully assigned as follows: 
      Engine:        XPORT 
      Physical Name: /sasem/sasdir/config/Lev1/SASAppPrd/C:\Users\xxxxxxx\Documents\Work\Documentations - xxxxxxx\[filename].xpt.
28         proc copy inlib=xptfile outlib=a;
29         run;

WARNING: Library A does not exist.
NOTE: Input library XPTFILE is sequential.
ERROR: Physical file does not exist, /sasem/sasdir/config/Lev1/SASApp/C:\Users\xxxxxxx\Documents\Work\Documentations - xxxxxxx\[filename].xpt.
NOTE: Statements not processed because of errors noted above.
NOTE: PROCEDURE COPY used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      
NOTE: The SAS System stopped processing this step because of errors.
30         
31         GOPTIONS NOACCESSIBLE;
32         %LET _CLIENTTASKLABEL=;
33         %LET _CLIENTPROCESSFLOWNAME=;
34         %LET _CLIENTPROJECTPATH=;
35         %LET _CLIENTPROJECTPATHHOST=;
36         %LET _CLIENTPROJECTNAME=;
37         %LET _SASPROGRAMFILE=;
38         %LET _SASPROGRAMFILEHOST=;
39         
40         ;*';*";*/;quit;run;
2                                                          The SAS System                               12:04 Monday, April 22, 2019

41         ODS _ALL_ CLOSE;
42         
43         
44         QUIT; RUN;
45         

 

Thanks in advance! 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Your code is NOT trying to copy the data from the XPT into your WORK library.  To do that you would use OUTLIB=WORK on the PROC COPY command.

 

Your log shows two problems.

1) The directory you are trying to write the dataset to doesn't exist.

2) The path you are trying to use to reference the XPT file is invalid of the machine that is running SAS.

 

For both paths you need to use locations that the machine were SAS is running can see.  The interactive Enterprise Guide utility runs on a Windows machine but it connects to SAS running some where.  In your case you can tell from the log that SAS is running on Unix.  So you need to use paths that work on that Unix machine.  If the XPT file is only on your PC then you might need to first upload it to the SAS server.

 

View solution in original post

5 REPLIES 5
Tom
Super User Tom
Super User

Your code is NOT trying to copy the data from the XPT into your WORK library.  To do that you would use OUTLIB=WORK on the PROC COPY command.

 

Your log shows two problems.

1) The directory you are trying to write the dataset to doesn't exist.

2) The path you are trying to use to reference the XPT file is invalid of the machine that is running SAS.

 

For both paths you need to use locations that the machine were SAS is running can see.  The interactive Enterprise Guide utility runs on a Windows machine but it connects to SAS running some where.  In your case you can tell from the log that SAS is running on Unix.  So you need to use paths that work on that Unix machine.  If the XPT file is only on your PC then you might need to first upload it to the SAS server.

 

mikaelllr0
Fluorite | Level 6

Hello. I am having the same problem with him. However, I couldnt upload the XPT file because it says the file is too large. If that's the case, how the I access the data inside that XPT file?

 

Thank you

Durlov5
Calcite | Level 5
Hey Tom, thanks for the response. How do I upload this file to the SAS server? I'm not really sure where in the network the SAS server is located. I was able to upload an Excel file into my Work Library using one of the Task items (using point and click methods), however the code generated didn't provide any clues to how SAS is connecting to my laptop's C Drive.
Tom
Super User Tom
Super User

For the Excel file you probably used the import utility. That will convert the Excel file to a delimited file and upload the delimited.

There should be another EG task for file transfer. 

Durlov5
Calcite | Level 5

So there's some special program our admins use to transfer files. Found out after much hullabaloo. Thanks for your help though - guided me to the right path.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 12121 views
  • 0 likes
  • 3 in conversation