data indian(drop=MaxWindMPH) atlantic(drop=MaxWindKM) pacific;
set pg2.storm_summary(drop=MinPressure); *Notice where drop is here;
*drop=MinPressure; *This does not work? I have to include it into the set statement, but according to picture (see below) I should not have to?;
length Ocean $ 8;
Basin=upcase(Basin);
StormLength=EndDate-StartDate;
MaxWindKM=MaxWindMPH*1.60934;
if substr(Basin,2,1)="I" then do;
Ocean="Indian";
output indian;
end;
else if substr(Basin,2,1)="A" then do;
Ocean="Atlantic";
output atlantic;
end;
else do;
Ocean="Pacific";
output pacific;
end;
run;
drop=MinPressure;
is not valid syntax. If you remove the equal sign, it should work. (When you use DROP as a data set option as in a SET statement, then the equal sign is required)
drop=MinPressure;
is not valid syntax. If you remove the equal sign, it should work. (When you use DROP as a data set option as in a SET statement, then the equal sign is required)
The DROP statement is its own statement and cannot be part of another statement.
The DROP= dataset option can be part of any dataset specification (SET, MERGE, DATA, DATA=, CREATE TABLE AS, FROM).
I STRONGLY suggest you use the SAS documentation for your further studies, particularly the DROP Statement
@SasStatistics
From the screenshot, it looks like you are taking some training. I would suggest that you go back over the Directing DATA Step Output section, as it probably explained the difference between Drop Statement and Drop Data Set Option.
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.
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.