I am trying to capture a phrase from my dataset that includes a bunch of terms. I am using PROC SQL to get the list of variables separated by a comma. I need to use this phrase in a SAS function with IN: (which I believe finds instances that carry the relevant string). But the code gives me 0 observations despite having variables in my data.
SAS DATA STEP:
proc sql noprint; select upcase("'"||STRIP(toxxx)||"'") into:neurolist separated by ', '
from test;quit; %put &neurolist;
LOG:
Macro variable NEUROLIST resolves to 'CONFUSION', 'DIZZINESS', 'HEADACHE', 'INSOMNIA', 'MEMORY IMPAIRMENT', 'TREMOR' 6767 %put &neurolist; 'CONFUSION', 'DIZZINESS', 'HEADACHE', 'INSOMNIA', 'MEMORY IMPAIRMENT', 'TREMOR'.
The codes doesn't get me an error. It works, but doesn't have any observations.
NOTE: There were 227 observations read from the data set WORK.MEDS_NEURO. NOTE: The data set WORK.NEURODEX has 0 observations and 7 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.03 seconds
Please see attachment for my dataset that has the term "HEADACHE", but my code doesn't capture it. Any idea why?
... View more