BookmarkSubscribeRSS Feed
Lani
Calcite | Level 5
I have a column named "EffectiveDate". I want to check for a record that has an EffectiveDate of "01-01-2010", then this record need to be removed. I don't know how to compare since the EffectiveDate is formated in Date type and the values look numerics. Can I use put function to convert the EffectiveDate to string? then I compare it with "01-01-2010". Your inputs are much appreciated.
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
You will need to determine the format (CHARACTER OR SAS/NUMERIC) of the date variables involved -- best to work with SAS NUMERIC variables and make comparisons. Suggest some basic SAS DATE variable review and reading from the SAS support http://support.sas.com/ website.

Scott Barry
SBBWorks, Inc.

SAS Language Reference: Concepts - Dates, Times, and Intervals
http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a001112342.htm
GertNissen
Barite | Level 11
if EffectiveDate = '01jan2010'd then delete;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 3662 views
  • 0 likes
  • 3 in conversation