Open p104p04.sas from the practices folder.
I tried the following codes but I am getting different answers.
data np_summary_update; set pg1.np_summary; keep Reg ParkName DayVisits OtherLodging Acres SqMiles Camping; SqMiles=Acres*.0015625; Camping=sum(OtherCamping,TentCampers, RVCampers,BackcountryCampers); format SqMiles comma6. Camping comma10.; run;
So, the question is and the answers in the answerkey are: SqMiles 1,014 and Camping 6,375.
and my answers are: SqMile 77 and Camping 201,741
I copied and pasted the codes from the answer key and still geting the same results (77, 201741). I did not sort the data in anyway nor the question asked to sort the data.
Did anyone else had the same issue?
Hi:
My guess is that somehow the original dataset, pg1.np_summary got corrupted or lost rows. When you run a PROC CONTENTS on pg1.np_summary, you should see 135 observations or rows and 10 columns or variables, as shown in the PROC CONTENTS output below:
Another way to check is to look in your log. You should see something like this:
If you have anything OTHER than 135 as the number of observations for pg1.np_summary, then it is a good idea to re-run the data creation program again to refresh the data.
When I run the program against the data with 135 observations, the first observation is for the ParkName value of Cape Krusenstern National Monument the SqMiles value is 1,014 and the Camping value is 6,375 . Please go back to the Course Overview instructions and re-run the program to re-create the data for the class. The answer key is correct and it seems like something happened to your data, perhaps accidentally that changed pg1.np_summary.
Cynthia
You can check the validity of your code quite easily, by doing the calculation yourself with the values found in the dataset. After all, it's just one multiplication and adding of 4 values.
If the dataset is the result of an earlier task of yours, go back there to see if you calculate the correct values there.
Hi:
My guess is that somehow the original dataset, pg1.np_summary got corrupted or lost rows. When you run a PROC CONTENTS on pg1.np_summary, you should see 135 observations or rows and 10 columns or variables, as shown in the PROC CONTENTS output below:
Another way to check is to look in your log. You should see something like this:
If you have anything OTHER than 135 as the number of observations for pg1.np_summary, then it is a good idea to re-run the data creation program again to refresh the data.
When I run the program against the data with 135 observations, the first observation is for the ParkName value of Cape Krusenstern National Monument the SqMiles value is 1,014 and the Camping value is 6,375 . Please go back to the Course Overview instructions and re-run the program to re-create the data for the class. The answer key is correct and it seems like something happened to your data, perhaps accidentally that changed pg1.np_summary.
Cynthia
I tried re-uploading the data and now I am getting correct results. Thanks, @Cynthia_sas and everyone!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Follow along as SAS technical trainer Dominique Weatherspoon expertly answers all your questions about SAS Libraries.
Find more tutorials on the SAS Users YouTube channel.