Search notes:

SAS data step: set

data abc;
  infile datalines;
  input
    col_num
    col_txt $50.
  ;

datalines;
1 foo
2 bar
3 baz
4 MoreThanEightCharacters
;


data mult_2;
  set abc;
  col_num = col_num * 2;
run;

proc print data=mult_2;
run;
Github repository about-SAS, path: /programming/data-step/set.sas

Limiting the observations

obs=n limits the read observations to n.
data orig;
  do i = 1 to 10;
     j = i*i;
     output;
  end;
run;

data only_4;
  set orig(obs=4);
run;

proc sql;
  select * from only_4;
quit;
Github repository about-SAS, path: /programming/data-step/set/obs/limit.sas

Index