BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jackice
Calcite | Level 5

Hi, Im using SAS University Studio 3.4, after 10 years of not using it. 

 

The snippets Filter doesnt allow to delete or filter out data line base on the sas created obs#  

 

I wish to use a simple data net set old if then delete statement but using the OBS# as the criteria 

 

Can somoene pls give me the code I need for that? 

 

THANKS! 

1 ACCEPTED SOLUTION
5 REPLIES 5
NScheperle
Fluorite | Level 6

I believe you could do something like this to delete observation #1. _n_ is an automatically generated variable in data steps that's dropped from the output.

 

data newtable;

  set oldtable;

  if _n_ ne 1;

run;

jackice
Calcite | Level 5
ill try that thanks - what “ne” stands for exactly pls?

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 5 replies
  • 9333 views
  • 2 likes
  • 3 in conversation