BookmarkSubscribeRSS Feed
dhuerta
Calcite | Level 5

I’m trying to delete certain data with variables not equal to one, but the below code deletes all the data. I can’t figure out the OR statement so that not all the data is deleted. I’m running a relative risk analysis and have included that code for reference

 

ata hf8mb;
set hf8;
time = 0 ;
if timelapse < .8 then delete;
if surver = 'BIT1' then delete;
if met_brst_scrn ne 1 then delete;
if met_cer_scrn ne 1 then delete;
if met_cer_scrn ne 1 then delete;
if met_co_scrn ne 1 then delete;
if met_pneu_vac ne 1 then delete;
if met_hpv_vac ne 1 then delete;
if met_flu_vac ne 1 then delete;
keep time par_id.... 

 

proc freq data=hf8m3 order=data;
tables time*need_brst_scrn / relrisk;
run;

3 REPLIES 3
ballardw
Super User

The SAS DELETE statement removes observations.

 

Are you intending to set values to missing so they are not included in analysis?

Might be a good idea to show an example of your data and what you expect the result to look like AFTER this process is done.

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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
  • 321 views
  • 0 likes
  • 3 in conversation