data Extract; length Subjects $40; input Subjects $; cards; Archaeology Architecture and Built Environment Art and Design Classics and Ancient History English Language and Literature History Linguistics Modern Languages Performing Arts Philosophy
Theology, Divinity and Religious Studies ; run;
Hello,
Please find abv sample data . where output should be in a new field method2 be as below .
I am confused that do I have to use substring and scan ? but how that I am confused .
method2 |
Built Environment |
Design |
Ancient History |
Literature |
Religious Studies |
Thanks in advance ! 🙂
data Extract;
input Subjects $40.;
p=findw(Subjects,'and');
if p then want=substr(Subjects,p+4);
cards;
Archaeology
Architecture and Built Environment
Art and Design
Classics and Ancient History
English Language and Literature
History
Linguistics
Modern Languages
Performing Arts
Philosophy
Theology, Divinity and Religious Studies
;
run;
data Extract;
input Subjects $40.;
p=findw(Subjects,'and');
if p then want=substr(Subjects,p+4);
cards;
Archaeology
Architecture and Built Environment
Art and Design
Classics and Ancient History
English Language and Literature
History
Linguistics
Modern Languages
Performing Arts
Philosophy
Theology, Divinity and Religious Studies
;
run;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.