DATA Step, Macro, Functions and more

proc surveyselect question

Reply
Frequent Contributor
Posts: 91

proc surveyselect question

[ Edited ]

is there any option for surveyselect to create an empty dataset when there are no records in the dataset it is selecting from does not have any records?

 

If not, is there another option to random sampling what will produce a output dataset with no records.

 

Thanks,

Elliott

Esteemed Advisor
Posts: 5,403

Re: proc surveyselect question

What kind of sampling are you trying to do? Please post your surveyselect code.

PG
Super User
Posts: 13,084

Re: proc surveyselect question


@Elliott wrote:

is there any option for surveyselect to create an empty dataset when there are no records in the dataset it is selecting from does not have any records?

 

If not, is there another option to random sampling what will produce a output dataset with no records.

 

Thanks,

Elliott


What do you expect to be in the output set after "randomly " selecting nothing from nothing?

 

If you want to create data set with the same structure but no records then

data junk;
   set sashelp.class (obs=0);
run;

Surveyselect given a zero record input set will generate an output set with zero records and zero variables. Not very useful as far as I can see.

 

Frequent Contributor
Posts: 91

Re: proc surveyselect question

I know it makes no sense. I an just trying not to have the code error in a production environment. Sometimes there are no records that meet the criteria to sample from. I just need a blank data set in that case to produce a empty sheet in the reporting I am providing.
Super User
Posts: 13,084

Re: proc surveyselect question


@Elliott wrote:
I know it makes no sense. I an just trying not to have the code error in a production environment. Sometimes there are no records that meet the criteria to sample from. I just need a blank data set in that case to produce a empty sheet in the reporting I am providing.

Are you wanting the Surveyselect tables with the selection method and summary of input/output sets with weights or something else?

What exact type of selection are you doing? Does your current empty input set generate errors?

 

 

Ask a Question
Discussion stats
  • 4 replies
  • 79 views
  • 0 likes
  • 3 in conversation