BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SasStatistics
Pyrite | Level 9
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;


SasStatistics_0-1621335638686.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
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)

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26
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)

--
Paige Miller
Kurt_Bremser
Super User

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).

STRONGLY suggest you use the SAS documentation for your further studies, particularly the DROP Statement 

AMSAS
SAS Super FREQ

@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.

SAS Innovate 2025: Register Today!

 

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.


Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 728 views
  • 3 likes
  • 4 in conversation