1

I have a raw data set in my files in SAS provided by the prof, she wants us to read the (.dat) file in SAS, use a LIBNAME, PROC IMPORT then PROC PRINT.... my proc import was working fine on it's own, now all I get is SAS import unsuccessful, I need a LIBNAME first, and PROC PRINT after, LIBNAME gives me the warning, PROC IMPORT (without a library) worked perfectly, but then I still couldn't PROC PRINT. I have even used ParkAttendance

LOG After LIBNAME:

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 68         
 69         LIBNAME pbdata '~/home/u62184071/ParkAttendance.dat';
 NOTE: Libref PBDATA refers to the same physical library as MYDATA.
 *WARNING: Library PBDATA does not exist.*
 NOTE: Libref PBDATA was successfully assigned as follows: 
       Engine:        V9 
       Physical Name: /home/u62184071/home/u62184071/ParkAttendance.dat
 70         RUN;

Whole code here:

LIBNAME pbdata '/home/u62184071/home/u62184071/ParkAttendance.dat';
RUN;



PROC IMPORT DATAFILE = '/home/u62184071/home/u62184071/ParkAttendance.dat'
  OUT = pbdata.ParkAttendance
  DBMS = TAB REPLACE;

RUN;

TITLE 'Top 10 Amusement Park Attendance Data'

*/There are 7 variables and 10 observations in the ParkAttendance data file.;

PROC PRINT ParkAttendance.pbdata;

RUN;

*My professor seemed to shrug off the PBDATA and the MYDATA note.

I have been at this one single question for 3 weeks, nd no one at SAS can answer my question.

Lastly I have created dozens of libraries but it still says they are not existent.

I know it's a lot. But I would be forever grateful. I'm kinda going insane bc I know it can't be this difficult.

Thank you!

Tom
  • 47,574
  • 2
  • 16
  • 29
  • Have you tried using backslashes instead of slashes in your physical name? In my setup using slashes sometimes causes some issues (and we were taught to use backslashes instead). Also, you don't need a run line in LIBNAME declaration. – Negdo Sep 23 '22 at 05:46
  • 1
    Two things... Standard libnames should point to the path, not the file - drop ParkAttendance.dat off the libname statement. PROC PRINT has LIBNAME.MEMNAME the wrong way round also, should be PBDATA.PARKATTENDANCE – Chris J Sep 23 '22 at 08:12
  • Thank you both! I am going to try both ways - all ways and I did notice that my file was backward - I was trying to find ANY reason to figure it out. I'll post when I figure it out. Thank you both again so much! –  Sep 23 '22 at 15:47

0 Answers0