We have a SAS data set one in which we have a variable Name:
ONE
Name
Ram Kumar m
Sita Singh
Radha Kumari Pathak
Arjun Rana
Write a SAS program to create another SAS data set TWO by reading SAS data set ONE:
TWO
Fname Mname Lname
Ram Kumar m
Sita Singh
Radha Kumari Pathak
Arjun Rana
Now prepare your Base SAS and
Advance SAS Certification Exams with Online Mock tests: http://exam.sankhyana.com
For training related info kindly mail us at info@sankhyana.com
www.sankhyana.com
ONE
Name
Ram Kumar m
Sita Singh
Radha Kumari Pathak
Arjun Rana
Write a SAS program to create another SAS data set TWO by reading SAS data set ONE:
TWO
Fname Mname Lname
Ram Kumar m
Sita Singh
Radha Kumari Pathak
Arjun Rana
Now prepare your Base SAS and
Advance SAS Certification Exams with Online Mock tests: http://exam.sankhyana.com
For training related info kindly mail us at info@sankhyana.com
www.sankhyana.com
using very basic SAS
ReplyDeletedata names;
input name $ 1-19 @;
cards;
Ram Kumar m
Sita Singh
Radha Kumari Pathak
Arjun Rana
;
run;
data sName;
set names;
Fname=scan(name,1,' ');
Mname=scan(name,2,' ');
Lname=scan(name,-1,' ');
if Mname=Lname then
Mname='';
run;
proc print;
run;