Dear all,
I have a coding question. In the data structure below I have the name of the firm, the class of asset (common or preferred stock) and when the class series started (date variable). Sometimes firm names appear more than one time since they may have 2 or more classes of assets containing different starting dates. Some firms have only one asset class. In these cases I will keep whatever class is available e.g either PN or ON. But for firms with multiple classes, I want to keep ON. If there is more than one ON series available to a firm, I want to keep the one with the oldest starting date. If no ON is available, I want to keep PN. If multiple PNs are available, I want the oldest and so on. I am stuck trying to code this. Any clues?

I have a coding question. In the data structure below I have the name of the firm, the class of asset (common or preferred stock) and when the class series started (date variable). Sometimes firm names appear more than one time since they may have 2 or more classes of assets containing different starting dates. Some firms have only one asset class. In these cases I will keep whatever class is available e.g either PN or ON. But for firms with multiple classes, I want to keep ON. If there is more than one ON series available to a firm, I want to keep the one with the oldest starting date. If no ON is available, I want to keep PN. If multiple PNs are available, I want the oldest and so on. I am stuck trying to code this. Any clues?
Comment