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

proc print data=pg1.np_summary(obs=20); var Reg Type ParkName DayVisits TentCampers RVCampers; run;

 

Having trouble with this.

 

1. Have got PG1 back - Though doesn't look as though NP parks is in that folder, should it be?

2. Tried using full properties description for np parks summary - Still getting loads of errors

 

Any ideas / solutions would be welcome.

 

Thanks,

 

Stu

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  The way you "put stuff" into the PG1 folder is by following the instructions to MAKE the data for the course. All the data in the PG1 course is in the /data subfolder. It is not correct to have a partial path in your statements. You need the FULL path. Here are some examples specific to this practice (and these examples assume that you have made the data correctly).

1) Local Configuration of SAS on my C: drive:

libname pg1 "c:\sas_class\EPG194\data";

 

2) SAS University Edition in a Virtual Machine:

libname pg1 "/folders/myfolders/EPG194/data";

 

3) SAS OnDemand for Academics account on cloud server (has 2 alternatives):

libname pg1 "/home/<userid>/EPG194/data";

or

libname pg1 "~/EPG194/data";

 

4) SAS Enterprise Guide with a local or server configuration:

libname pg1 "&path";

 

  If you remember, in Lesson 2, there were EXACT instructions in a REQUIRED activity for you to make a file called LIBNAME.SAS in order to define the PG1 library. So the above are examples for the possible LIBNAME statements you might have in your LIBNAME.SAS file. Once you define a library reference with a LIBNAME statement, that means you no longer have to use the "sas7bdat" file extension in your code. Here's the required activity in Lesson 2:

make_libname_Lesson2.png

 

Based on your error message, there are several things that you are doing wrong. First, it doesn't look like you're using the PG1 library reference at all because you put part of the operating system file name in quotes after data=; next, the (obs=20) is NOT part of the DATA= option:

solution_np_summary.png

 

Note that there is a Reminder at the top of the Practice that tells you, explicitly, to submit LIBNAME.SAS before you start. If LIBNAME.SAS is incorrect, then none of the other practices in the course are going to work for you. So you need to go back to Lesson 2 and make sure that you have correctly created the LIBNAME.SAS file so it points to your DATA folder.

 

  The easiest way to get the correct path for your LIBNAME statement is to find the EPG194/data folder in SAS Studio, click once on the data folder name and then right-click and select Properties. In the Location field on the Properties window, you will see the correct FULL path that you should use. Then you would construct your libname.sas program file, as instructed.

 

  If you do not understand the purpose of a LIBNAME statement, then please go back to Lesson 2 and re-watch the lecture entitled "Using a Library to Read SAS Data", in particular, time stamp 1:28-2:38 as shown below:

snip_from_lecture.png

 

Note that in the lecture, when you use a library reference, such a MYLIB or PG1, you do NOT need to put the name of the dataset in quotes and you do NOT need to use the sas7bdat file extension.

 

  Once you get your LIBNAME statement figured out, the solution that is shown inside the course practice slide should work for you, as written.

 

Hope this helps,

Cynthia

View solution in original post

8 REPLIES 8
PeterClemmensen
Tourmaline | Level 20

Please post the errors from the log

Stu44
Fluorite | Level 6
OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
70
71 proc print data="data/np_summary.sas7bdat (obs=20)";
ERROR: The physical file name "data/np_summary.sas7bdat (obs=20)" is too long.
72 var Reg Type ParkName DayVisits TentCampers RVCampers;
73 run;
 
Also not sure if I should save stuff to PG1 - Its empty at the moment. Any ideas how to quickly move stuff in there?
 
Thanks
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

proc print data='/home/YOURID/EPG194/data/np_summary.sas7bdat'(obs=20);
run;

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

check all of the folders in PG1 and find the dataset you need, you may need to create a libname statement to the folder that contains the required incoming data.

Stu44
Fluorite | Level 6

Think that may be the problem - Got pg set up but nothing in it

 

Any simple ways to move stuff there?

 

Thnaks

Cynthia_sas
SAS Super FREQ

Hi:

  The way you "put stuff" into the PG1 folder is by following the instructions to MAKE the data for the course. All the data in the PG1 course is in the /data subfolder. It is not correct to have a partial path in your statements. You need the FULL path. Here are some examples specific to this practice (and these examples assume that you have made the data correctly).

1) Local Configuration of SAS on my C: drive:

libname pg1 "c:\sas_class\EPG194\data";

 

2) SAS University Edition in a Virtual Machine:

libname pg1 "/folders/myfolders/EPG194/data";

 

3) SAS OnDemand for Academics account on cloud server (has 2 alternatives):

libname pg1 "/home/<userid>/EPG194/data";

or

libname pg1 "~/EPG194/data";

 

4) SAS Enterprise Guide with a local or server configuration:

libname pg1 "&path";

 

  If you remember, in Lesson 2, there were EXACT instructions in a REQUIRED activity for you to make a file called LIBNAME.SAS in order to define the PG1 library. So the above are examples for the possible LIBNAME statements you might have in your LIBNAME.SAS file. Once you define a library reference with a LIBNAME statement, that means you no longer have to use the "sas7bdat" file extension in your code. Here's the required activity in Lesson 2:

make_libname_Lesson2.png

 

Based on your error message, there are several things that you are doing wrong. First, it doesn't look like you're using the PG1 library reference at all because you put part of the operating system file name in quotes after data=; next, the (obs=20) is NOT part of the DATA= option:

solution_np_summary.png

 

Note that there is a Reminder at the top of the Practice that tells you, explicitly, to submit LIBNAME.SAS before you start. If LIBNAME.SAS is incorrect, then none of the other practices in the course are going to work for you. So you need to go back to Lesson 2 and make sure that you have correctly created the LIBNAME.SAS file so it points to your DATA folder.

 

  The easiest way to get the correct path for your LIBNAME statement is to find the EPG194/data folder in SAS Studio, click once on the data folder name and then right-click and select Properties. In the Location field on the Properties window, you will see the correct FULL path that you should use. Then you would construct your libname.sas program file, as instructed.

 

  If you do not understand the purpose of a LIBNAME statement, then please go back to Lesson 2 and re-watch the lecture entitled "Using a Library to Read SAS Data", in particular, time stamp 1:28-2:38 as shown below:

snip_from_lecture.png

 

Note that in the lecture, when you use a library reference, such a MYLIB or PG1, you do NOT need to put the name of the dataset in quotes and you do NOT need to use the sas7bdat file extension.

 

  Once you get your LIBNAME statement figured out, the solution that is shown inside the course practice slide should work for you, as written.

 

Hope this helps,

Cynthia

Stu44
Fluorite | Level 6

Thanks once again, Cynthia,

 

It was so basic what I was doing wrong, the more I looked the less I saw!

 

Thanks for getting me back on track.

 

Regards,

 

Stu

Chaoyiliu
Calcite | Level 5

Hello, 

I really appreciate the answers you gave and I solved my problem which stuck me one day!

 

Thank you again 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 8 replies
  • 7090 views
  • 5 likes
  • 5 in conversation