I have a problem which I hope someone could help me with. Below is a description of my problem.

I have a dataset which looks like the below:

ID Gender Car

1 F A

1 F B

1 F C

2 M A

2 M B

I would like to collapse the dataset above based on the duplicate ID and create new columns for the Car variable. The output dataset I would like to have looks like the below:

ID Gender Car1 Car2 Car3

1 F A B C

2 M A B

I have quite a large number of clients (ie. the ID variable) in my dataset - from memory I think I have about 9000 IDs, so would be good if I have a SAS code which can deal with large numbers if IDs.

Can anyone help me with the SAS codes for the above? Much appreciated in advance! Thanks