Hello, I am a beginner using Stata 15. I have a data in the long format which I will like to convert to wide format. I have a column with unique IDs and for each ID the date is the same but the drug options are multiple with up to 26 different dugs possible (but each patient ID has a maximum of seven drugs).
Present format
id drug date
1001 drug A 31 May 2019
1001 drug B 31 May 2019
1001 drug C 31 May 2019
1002 drug A 20 May 2019
1002 drug B,D 20 May 2019
1003 drug E 10 May 2019
1003 drug F 10 May 2019
1004 drug A, B, C 30 May 2019
1004 drug A 30 May 2019
1004 drug C 30 May 2019
1004 drug B 30 May 2019
Desired format
id date drug1 drug2 drug3 drug4
1001
1002
1003
*where Drug1 represents the drug occurring in the first row for a given ID, Drug 2 for the drug on the second row for same ID … (order is not important)

I have attempted
reshape wide drug1 drug2 drug3 drug4 drug5 drug6 drug7, i(id) j(drug)
with this error message
variable drug is string; specify string option

I am unsure of how next to proceed, Please, I need assistance.
Kind regards.