Hello, I am trying to parse out the drug name, strength, and unit variable for specific medications only (Amantadine, Carbidopa, Entacapone, Apomorphine, Trihexyphenidyl, Amantadine, Trihexyphenidyl, and levodopa). The final aim is to calculate the daily dose of these medications. I have tried using the scan, compress followed by the coalescec option to no avail. 1) Things to note a) Use of different delimeters "-" and "/" for the strength variable, (b) different position of drug of interest : position1/position2/position3. I have included my data and table desired. Thank you for your assistance. data WORK.HAVE; infile datalines dsd truncover; input Patient_ID:32. Drug_Name:$37. Strength:$12.; label Patient_ID="Patient ID" Drug_Name="Drug_Name" Strength="Strength"; datalines; 1 Carbidopa 25 MG 1 Carbidopa/Levodopa 25-100 MG 2 Levodopa/Entacapone 100-200 MG 2 Apomorphine 2 MG/ML 2 Ropinirole/Entacapone 2-200 MG 3 Levodopa/Entacapone/Ropinirole 100-200-2 MG 3 Pramipexole/Entacapone/Amantadine 1-200-100 MG 3 Pramipexole/Trihexyphenidyl 1-2 MG 4 Amantadine/Benztropine 100-1 MG 5 Trihexyphenidyl/Rasagiline/Entacapone 2-0.5-200 MG ;;;; Want Patient ID Drug_of_Interest Strength1 Unit1 Drug of interest 2 Strength2 Unit2 1 Amantadine 100 MG . . 1 Carbidopa 25 MG Levodopa 100 MG 2 Entacapone 200 MG . . 2 Apomorphine 2 MG/ML . . 2 Entacapone 200 MG . . 3 Entacapone 200 MG 3 Entacapone 200 MG Amantadine 100 MG 3 Trihexyphenidyl 2 MG . . . 4 Amantadine 100 MG . . . 5 Trihexyphenidyl 2 MG Entacapone 200 MG
... View more