Hello,
I am a new SAS user.
I have the following dataset:
data have;
input Company_ID $4. Date Fiscal_Year;
informat Date date9.;
format Date date9.;
cards;
1210 31mar2009 2009
1210 31may2010 2010
1210 30jun2010 2011
1211 31jan2009 2009
1212 26feb2010 2010
1212 31may2011 2011
1213 30jun2006 2006
1213 27jul2007 2007
;
run;
I want to create a dataset which will contain the observation under a certain Company_ID only for the last Fiscal_Year.
You can ignore the Date column.
As you will notice, for Company_ID 1211, there is only one observation for Fiscal_Year 2011.
Thus, it will remain as it is.
However, for Company_ID 1210, only the observation from Fiscal_Year 2011 will remain.
I am expecting the following output:
Company_ID | Date | Fiscal_Year |
1210 | 30JUN2010 | 2011 |
1211 | 31JAN2009 | 2009 |
1212 | 31MAY2011 | 2011 |
1213 | 27JUL2007 | 2007 |
Thank you so much for your kind support!