BookmarkSubscribeRSS Feed
batulelec
Calcite | Level 5

Hi! 

 

I have 2 cases in which I have 0 values in my dataset - 

 

Case 1 - 

Member       Diagnosis           Date       Location        Cost

1                      dx1            8/3/2016          ER           5000

1                      dx1            8/3/2016          ER           3652

1                      dx1            8/3/2016          ER              0

 

Case 2 -

Member       Diagnosis           Date       Location        Cost

2                     dx2            8/3/2016       Inpatient        7000

2                     dx3            8/3/2016          ER                 0

 

In Case 1, I want to delete the 0 observation since it is a duplicate of the one before it, except for the cost.

In Case 2, I don't want to delete the 0 value since it is unique.

 

This is what I want my output to look like - 

Member       Diagnosis           Date       Location        Cost

1                      dx1            8/3/2016          ER           5000

1                      dx1            8/3/2016          ER           3652

2                     dx2            8/3/2016       Inpatient        7000

2                     dx3            8/3/2016          ER                 0

 

What is the best way ot go about doing this? Thank you!

1 REPLY 1
LinusH
Tourmaline | Level 20
Try proc sort with the NODUPKEY option.
Data never sleeps

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 672 views
  • 0 likes
  • 2 in conversation