ERROR: Physical file does not exist {on SAS studio (Academic ondemand-web based)}

641 views Asked by At

I am combining two XPT files with following program code:

    LIBNAME DM XPORT '/home/u62208181\DEMO.XPT';
        LIBNAME QX XPORT '/home/u62208181\CDQ.XPT';
        LIBNAME OUT '/home/u62208181';
        
        DATA OUT.CDQ_DEMO;
           MERGE DM.DEMO (KEEP=SEQN RIDAGEYR RIAGENDR) 
                 QX.CDQ (IN=A);
           BY SEQN;

   IF A;
   RUN;

Even though files are in folder- SAS show this error Image clearly show file in upload section

2

There are 2 answers

0
Reeza On BEST ANSWER

Try converting the XPT to SAS data sets first. Note that Unix is case sensitive, if you still get an error right click on the XPT file in the folder and copy the path from properties and paste that into your path.

LIBNAME DM XPORT '/home/u62208181/DEMO.XPT';
LIBNAME QX XPORT '/home/u62208181/CDQ.XPT';
LIBNAME OUT '/home/u62208181';
        
PROC COPY IN=DM  OUT= OUT;
SELECT DEMO;
RUN;

PROC COPY IN=QX OUT=OUT;
SELECT CDQ;
RUN;

DATA OUT.CDQ_DEMO;
    MERGE OUT.DEMO (KEEP=SEQN RIDAGEYR RIAGENDR) 
          OUT.CDQ (IN=A);
    BY SEQN;

    IF A;
RUN;
0
Tom On

The \ character in Unix is used to "escape" the following character. So this path

/home/u62208181\DEMO.XPT

Is the same as

/home/u62208181DEMO.XPT

Which should not exist since only user directories should be in the /home folder and if it did exist you probably would not have access to it since it is not in your home directory.

Try using / instead.

/home/u62208181/DEMO.XPT

Note that the LIBNAME statements work because SAS does not know whether you are expecting to read from an existing file or create a new file. It is only when the code actually tries to read from the library that SAS warns you that the file does not yet exist.