05-01-2012 11:11 AM
I want to loop thru each of record to see if value in a particular date fields gets changed over time. There are multiple records for same entity in my table(kind of history table).
Any idea how to do this using data setp/proc sql.
thanks in advance,
05-01-2012 11:37 AM
I have a table where historical info related to that entity is stored over time.
Entity_ID, col 2 , col 3 ...etc , and few date fields. So I want to check if a particular entity id is changed over time(against one of date fields) or not ?
05-01-2012 04:39 PM
You may want to show some sample data and sample output. I'm guessing you want something like:
input entity_id $4. datecol1 ddmmyy8.;
format datecol1 mmddyy8.;
select distinct entity_id, datecol1 from have;
Output would be:
05-01-2012 06:44 PM
Not 100% clear on what you're looking for, an example of what your data looks like would be helpful.
Using Jason data the following will give you distinct entries for records where the datecol1 are have different entries. You can remove the distinct keyword for all entries instead.
create table want as
select distinct * from have
group by entity_id
having min(datecol1) ne max(datecol1);