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: Call for Content

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 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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