My SAS Tutorials

Wednesday 1 October 2014

SAS INTERVIEWS CONCEPTUAL QUESTIONS XXVI

We have a SAS data sets in that we have 100 variables.
 We need to read only 50th and 8th variable to create another SAS Data sets.

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

4 comments:

  1. data Var;
    do _n_=50, 8;
    set one point=_n_;
    output;
    end;
    stop;
    run;

    ReplyDelete
  2. We have to read 50th and 8th column..not observations.

    ReplyDelete
  3. proc transpose data = a out = b;
    var _all_;
    run;
    data bb;
    do _n_ = 4,1;
    set b point = _n_;
    output;
    end;
    stop;
    run;
    proc transpose data = bb out = bbb(drop = _name_);
    id _name_;
    var col1-col4;
    run;

    ReplyDelete
  4. to take random columns , say C3 and C5

    Data one;
    infile datalines _infile_ = X;
    input ;
    c3=scan(X,3,' ');
    c5=scan(X,5,' ');
    datalines;
    1 2 3 4 5 6 7
    8 9 0 1 2 3 4
    5 6 7 8 9 0 1
    2 3 4 5 6 7 8
    9 0 1 2 3 4 5
    ;
    run;

    ReplyDelete