Hello everyone,
In the first level of the practice dedicated to the first lesson of the second course, it is requested to create three tables : monument, park and other with the following conditions :
Drop Parktype for monument and park
Drop Region for the three tables.
The correct solution is :
data monument(drop=ParkType) park(drop=ParkType) other;
set pg2.np_yearlytraffic;
if ParkType = 'National Monument' then output monument;
else if ParkType = 'National Park' then output park;
else output other;
drop Region;
run;
But I tried to do it with "if then do" statements :
data monument park other;
set pg2.np_yearlytraffic;
drop Region;
if ParkType = 'National Monument' then
do;
drop Parktype;
output monument;
end;
else if ParkType = 'National Park' then do;
drop Parktype;
output park;
end;
else output other;
run;
The issue being that now, the table other does not contain "Parktype" and I don't understand why is that so.
Any help would be greatly appreciated.
Regards