Dear altruists,
I am a new SAS user.
I have the following dataset (I have attached the SAS dataset in the end):
| Company_ID | Date | Fiscal_Quarter |
| 1210 | 2009-03-31 | 4 |
| 1210 | 2009-06-30 | 1 |
| 1210 | 2009-09-30 | 2 |
| 1094 | 2009-03-31 | 3 |
| 1094 | 2009-06-30 | 4 |
| 1094 | 2009-09-30 | 1 |
| 1327 | 2009-03-31 | 2 |
| 1327 | 2009-06-30 | 3 |
| 1327 | 2009-09-30 | 4 |
| 1045 | 2009-03-31 | 1 |
| 1045 | 2009-06-30 | 2 |
| 1045 | 2009-09-30 | 3 |
| 1120 | 2009-03-16 | 4 |
| 1120 | 2009-06-30 | 1 |
| 1120 | 2009-09-30 | 2 |
I want to create two output datasets on the following condition:
During the period from 15 March 2009 to 14 March 2010, if the first observation of a certain Company_ID has a Fiscal_Quarter value of 4, then this observation should be put in a new dataset.
All the remaining observations will be sent to another dataset.
So, the first output dataset would be as follows:
| Company_ID | Date | Fiscal_Quarter |
| 1210 | 2009-03-31 | 4 |
| 1120 | 2009-03-16 | 4 |
And the second output dataset would be as follows:
| Company_ID | Date | Fiscal_Quarter |
| 1210 | 2009-06-30 | 1 |
| 1210 | 2009-09-30 | 2 |
| 1094 | 2009-03-31 | 3 |
| 1094 | 2009-06-30 | 4 |
| 1094 | 2009-09-30 | 1 |
| 1327 | 2009-03-31 | 2 |
| 1327 | 2009-06-30 | 3 |
| 1327 | 2009-09-30 | 4 |
| 1045 | 2009-03-31 | 1 |
| 1045 | 2009-06-30 | 2 |
| 1045 | 2009-09-30 | 3 |
| 1120 | 2009-06-30 | 1 |
| 1120 | 2009-09-30 | 2 |
Thank you in advance for all your support!