Hi,
there is Activity 4.04 with a prepared code:
data storm_length;
set pg1.storm_summary;
drop Hem_EW Hem_NS Lat Lon;
*Add assignment statement;
run;
The following error pops up if I run this code.
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 72 73 data storm_length; 74 set pg1.storm_summary; 75 drop Hem_EW Hem_NS Lat Lon; 76 *Add assignment statement; 77 run; WARNING: The variable Hem_EW in the DROP, KEEP, or RENAME list has never been referenced. WARNING: The variable Hem_NS in the DROP, KEEP, or RENAME list has never been referenced. WARNING: The variable Lat in the DROP, KEEP, or RENAME list has never been referenced. WARNING: The variable Lon in the DROP, KEEP, or RENAME list has never been referenced. NOTE: There were 1 observations read from the data set PG1.STORM_SUMMARY. NOTE: The data set WORK.STORM_LENGTH has 1 observations and 0 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 743.56k OS Memory 29604.00k Timestamp 08.07.2022 02:45:58 пп Step Count 115 Switch Count 2 Page Faults 0 Page Reclaims 89 Page Swaps 0 Voluntary Context Switches 17 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 160 78 79 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 91
I found another library with 2 in the end and changed the code accordingly.
set pg1.storm_summary2;
Then the task can be completed.
Just in case if someone faces the same issue or for a QC review if that is the case.
UPD: but there is no Agatha storm in that table:)))
UPD2: but Agatha can be found in PG1.STORM_RANGE:)))
If the data set has no observations, it may have been inadvertently damaged during a previous practice exercise or demo click-through. For SAS programming classes, this usually involved re-running a program named cre8data.sas or setup.sas. The "Course Overview and Data Setup (REQUIRED)" instructions you used when you first set up the data for the class will give you the details, which may vary a little depending on if you are using a SAS Virtual Lab, SAS On Demand for Academics, or your own SAS installation with SAS Studio, SAS Enterprise Guide, or the SAS Windowing Environment. Follow those instructions will restore your course SAS data sets to their initial condition, and this should fix the problem for you.
The instructions for Activity 4.04:
***********************************************************;
* Activity 4.04 *;
* 1) Add an assignment statement to create StormLength *;
* that represents the number of days between *;
* StartDate and EndDate. *;
* 2) Run the program. In 1980, how long did the storm *;
* named Agatha last? *;
***********************************************************;
The code I'd write for this:
data storm_length;
set pg1.storm_summary;
drop Hem_EW Hem_NS Lat Lon;
*Add assignment statement;
StormLength =EndDate-StartDate ;
run;
runs without error:
NOTE: There were 3118 observations read from the data set PG1.STORM_SUMMARY.
NOTE: The data set WORK.STORM_LENGTH has 3118 observations and 9 variables.
And my result contains the storm Agatha:
Obs | Season | Name | Basin | Type | MaxWindMPH | MinPressure | StartDate | EndDate | StormLength |
---|---|---|---|---|---|---|---|---|---|
1 | 1980 | na | TS | 35 | . | 17JUL1980 | 18NOV1980 | 124 | |
2 | 1980 | SP | NR | . | 998 | 27MAR1980 | 30MAR1980 | 3 | |
3 | 1980 | AGATHA | EP | TS | 115 | . | 09JUN1980 | 15JUN1980 | 6 |
4 | 1980 | ALBINE | SI | ET | . | . | 27NOV1979 | 06DEC1979 | 9 |
5 | 1980 | ALEX | WP | TS | 40 | 998 | 09OCT1980 | 14OCT1980 | 5 |
If your PG1 library does not include the pg1.storm_summary data set, try re-running the cre8data.sas program.
All the best,
Mark
Lucky you:)
I have two libriaries and only one can be opened.
So, for the practice purpose I used storm_summary2.
Thank you for your comment.
If the data set has no observations, it may have been inadvertently damaged during a previous practice exercise or demo click-through. For SAS programming classes, this usually involved re-running a program named cre8data.sas or setup.sas. The "Course Overview and Data Setup (REQUIRED)" instructions you used when you first set up the data for the class will give you the details, which may vary a little depending on if you are using a SAS Virtual Lab, SAS On Demand for Academics, or your own SAS installation with SAS Studio, SAS Enterprise Guide, or the SAS Windowing Environment. Follow those instructions will restore your course SAS data sets to their initial condition, and this should fix the problem for you.
Go to the "Course Overview and Data Setup (REQUIRED)" instructions used to first set up the data for the class. The actual instructions will depend on if you are using a SAS Virtual Lab, SAS On Demand for Academics, or your own SAS installation using SAS Studio, SAS Enterprise Guide, or the SAS Windowing Environment. The name of the program you need to run, and directions on how to find it, are included there.
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!
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.