I have Table in SAS Enterprise Guide like below: Data type:
ID - numeric
SERVICE - character
ID SERVICE 123 P1 123 P1 123 G 444 AB 56 c2
And I need to know how many time each ID bought each SERVICE, so as a result I need something like below:
ID | P1| G | AB | c2
----|---|---|----|---
123 | 2 | 1 | 0 | 0
444 | 0 | 0 | 1 | 0
56 | 0 | 0 | 0 | 1
- Because for example ID = 123 bought SERVICE = P1 2 times and 0 times bought G, AB or c2 and so on in terms of other IDs.
How can I do that in PROC SQL in SAS Enterprise Guide ?