My SAS Tutorials

Thursday, 18 April 2013

SAS INTERVIEWS CONCEPTUAL QUESTIONS IX

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

1 comment:

  1. using very basic SAS

    data 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;

    ReplyDelete