I have some code where I am trying to save the first two words into their own variables, and everything after them into a third variable. Is there an elegant way to do this with an input statement?
I know I could read the entire string into a single variable and then chop it up into the pieces that I need but is it possible with the input command?
data email_list;
attrib word1 word2 everything_else length=$1000;
infile datalines truncover;
input word1 $
word2 $
everything_else $
;
datalines;
one two blah di blah
;
run;
The solution would have:
word1 = "one"
word2 = "two"
everything_else = "blah di blah"
I don’t think you can do that with list input. But, you can do it by switching up midstream: