Suppose I have a large sample data, that has two different date values for each firm. An announcement date and a trading date. I need to write a code that only extracts 12 days prior and 12 days after the announcement date - for each individual cusip and announcement dates. Moreover, some cusips (firms) have several announcement dates, which complicates the problem. Any help or suggestions would be greatly appreciated.