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
Diamond | Level 26

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
Diamond | Level 26

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.

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

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