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

New to Sas and trying to complete online training.

 

The e-learning shows the steps to create a library called PG1, PG1 successfully created:

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
70
71 libname PG1 "/home/u12345678/EPG194/data";
NOTE: Libref PG1 was successfully assigned as follows:
Engine: V9
Physical Name: /home/u12345678/EPG194/data
72
73 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
84
 
Trying to access the files using proc print data= "PG1/np_summary" (np_summary is in PG1 folder), the error below returns:
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
70
71 proc print data="pg1.np_summary" (obs=20);
ERROR: Extension for physical file name "pg1.np_summary" does not correspond to a valid member type.
72 var reg type parkname dayvisits tentcampers rvcampers;
73 run;
 
Thanks!
1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:
You should NOT have quotes after data= option. It should just be:
proc print data=pg1.np_summary (obs=20);
... more code...
run;

When you use a 2 level SAS name, you do NOT need quotes. The LIBNAME statement already points to the operating system folder path for the data. So, SAS knows to look for the np_summary.sas7bdat file in that location when you use the 2 level name. If you remember, back in the early part of class, we had you use the fully qualified path for the storm_summary data, like this:

proc contents data="/home/<yourUserID>/EPG194/data/storm_summary.sas7bdat" ;
run;

 

With a LIBNAME statement defined,

libname pg1 '/home/<yourUserID>/EPG194/data';

 

you can use the "nickname" or libref of PG1 to tell SAS where the SAS data is located in a folder on the operating system. SAS knows that SAS tables have a file extension of sas7bdat, so you can simplify the DATA= option with an UNQUOTED 2 level name, as shown below:
proc contents data=pg1.storm_summary ;
run;

OR

proc contents data=pg1.np_summary ;
run;

OR

proc print data=pg1.np_summary ;
run;

 

Hope this helps,
Cynthia

View solution in original post

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi:
You should NOT have quotes after data= option. It should just be:
proc print data=pg1.np_summary (obs=20);
... more code...
run;

When you use a 2 level SAS name, you do NOT need quotes. The LIBNAME statement already points to the operating system folder path for the data. So, SAS knows to look for the np_summary.sas7bdat file in that location when you use the 2 level name. If you remember, back in the early part of class, we had you use the fully qualified path for the storm_summary data, like this:

proc contents data="/home/<yourUserID>/EPG194/data/storm_summary.sas7bdat" ;
run;

 

With a LIBNAME statement defined,

libname pg1 '/home/<yourUserID>/EPG194/data';

 

you can use the "nickname" or libref of PG1 to tell SAS where the SAS data is located in a folder on the operating system. SAS knows that SAS tables have a file extension of sas7bdat, so you can simplify the DATA= option with an UNQUOTED 2 level name, as shown below:
proc contents data=pg1.storm_summary ;
run;

OR

proc contents data=pg1.np_summary ;
run;

OR

proc print data=pg1.np_summary ;
run;

 

Hope this helps,
Cynthia

ketone
Calcite | Level 5
It works! Thank you Cynthia.

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!

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.

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
  • 2 replies
  • 1599 views
  • 2 likes
  • 2 in conversation