Proc Sort syntax, options, Interview questions

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #49349
    rlochan2021
    Keymaster

    proc sort data=abc out=xyz;
    by descending a1 ascending a2 ;
    run;

    proc sort data=abc out=xyz;
    by _numeric_;
    run;

    proc sort data=abc out=xyz;
    by _all_;
    run;

    proc sort data=abc(firstobs=3 obs=5) out=xyz;
    by a1;
    run;

    proc sort data=abc out=xyz(rename=(a1=a2));
    by a1;
    run;

    proc sort data= abc SORTSEQ =LINGUISTIC (NUMERIC_COLLATION=ON);
    by a1;
    run;

    proc sort data=abc(where=(x>5)) out=xyz;
    by a1;
    run;

    NODUPRECS & NODUPKEY to remove Duplicates from SAS datasets:–

    The NODUPRECS (or NODUP) and NODUPKEY options work similarly in that they both can eliminate
    unwanted observations, but NODUP compares all the variables in your data set while NODUPKEY
    compares just the BY variables.
    More specifically, if you use the NODUP option, PROC SORT compares all
    variable values for each observation to those for the previous observation that was written to the output dataset.

    proc sort data=abc nodupkey out=xyz dupout = ijk;
    by a1;
    run;

    Proc Sort Options

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.