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?

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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