2

I use PROC SURVEYSELECT in SAS to sample a data set DT, OUT=DT_SAMPLED, but I would also like to have those samples in DT that didn't get selected. May I know if there is a way? Thanks in advance.

Kevin
  • 2,191
  • 9
  • 35
  • 49

1 Answers1

3

You can use the OUTALL statement on PROC SURVEYSELECT, which will output all records with a selected flag for selected records.

proc surveyselect data=sashelp.class outall out=classsamp n=5 seed=7;
run;

proc freq data=classsamp;
tables selected;
run;

You will see 5 selected (1) and 14 unselected (0).

Joe
  • 62,789
  • 6
  • 49
  • 67