I have rows of news which I need to give codes to based on individuals in the news. I am trying to do the following thing:
data zzz;
set yyy;
if there is "% Bernanke%" in Event, then there is a new column SF1=1; else SF1=0;
if there is "% Rosengren%" in Event, then there is a new column SF2=1; else SF2=0;
if there is "% Paulson%" in Event, then there is a new column SF3=1; else SF3=0;
… … … … … … … … … … … … … … … … … … … … … … … … … … … … …
run;
Also, I would like to set the length of the new variables (columns) SF1, SF2, SF3... to $5. How can I set the length for all the new columns at the beginning except writing: length SF1 $5.; for each new variable?
Regards.