Hi SAS community members, I have a data manipulation question. I have attached a spreadsheet with current data in "Sheet 1" and what I need in "Sheet 2". The data is at the occupant level. I want to change it to vehicle level. However, there is no vehicle ID. But the data is arranged in such a way that you could distinguish it by vehicle. For example, as you can see in the spreadsheet, the first obs is a driver (DRV), followed by front seat passenger (FSP), and then rear seat child passenger (RP1C). The fourth and fifth obs are both drivers only without any passengers and so on and so forth. I would like to arrange it in such a way that all occupants of vehicle 1 are in one row by creating additional variables as displayed in "Sheet 2" but I am having trouble doing so. There are six types of occupants: DRV, FSP, RP1C, RP2C, RP1P, and RP2P. If anyone has suggestions on how to achieve this, I would really appreciate it. Thank you for you help!
... View more