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
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:
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:
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:
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
Please post the errors from the log
proc print data='/home/YOURID/EPG194/data/np_summary.sas7bdat'(obs=20);
run;
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.
Think that may be the problem - Got pg set up but nothing in it
Any simple ways to move stuff there?
Thnaks
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:
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:
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:
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
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
Hello,
I really appreciate the answers you gave and I solved my problem which stuck me one day!
Thank you again
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.