BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Mystik
Obsidian | Level 7

Hello,

I am running a nested case-control sampling macro analysis matching on n=10 controls.

i.e..

proc surveyselect data=m4_case&i method=srs n=10 seed=2009 out=m6_case&i;
id IDnum case_id ctrl_id dx grp_cc;
run;

 

However, i get these messages when the matching number is less than 10;

 

ERROR: The sample size, 10, is greater than the number of sampling units, 9.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set M6_CASE2096 may be incomplete. When this step was stopped there were 0
observations and 5 variables.

 

I have relaxed my matching criteria to accommodate more case-control matches as possible.

For now i want to force the sas program to accept those n=9 etc to be matched using the same procedure stated above whilst still using the n=10 criteria. Pls any help will be welcome.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Mystik
Obsidian | Level 7

I replaced "PROC SURVEYSELECT" statement with SELECTALL as you suggested (find below) but got the error message:

 

6 selectall data=m4_case&i method=srs n=10 seed=2009 out=m6_case&i; 

---------

180

ERROR 180-322: Statement is not valid or it is used out of proper order.

 

selectall data=m4_case&i method=srs n=10 seed=2009 out=m6_case&i;
id IDnum case_id ctrl_id dx grp_cc;
run;

View solution in original post

6 REPLIES 6
Mystik
Obsidian | Level 7

I replaced "PROC SURVEYSELECT" statement with SELECTALL as you suggested (find below) but got the error message:

 

6 selectall data=m4_case&i method=srs n=10 seed=2009 out=m6_case&i; 

---------

180

ERROR 180-322: Statement is not valid or it is used out of proper order.

 

selectall data=m4_case&i method=srs n=10 seed=2009 out=m6_case&i;
id IDnum case_id ctrl_id dx grp_cc;
run;

FreelanceReinh
Jade | Level 19

Just adhere to the syntax described in the documentation Reeza linked to: SELECTALL is an option of the PROC SURVEYSELECT statement, so it needs to be inserted anywhere into the list of the five options you're currently using (DATA=, METHOD=, N=, SEED=, OUT=).

Mystik
Obsidian | Level 7
Thank you. I did as Reeza says and it worked.
Reeza
Super User
Whoops, that was autocorrect, the original messages should have said, within not without 🙂

Glad you got it working.
Mystik
Obsidian | Level 7
Thank you Reeza!
Actually, it was your solution that actually works. Dunno why i marked mine as the solution.
Thanks again.

SAS Innovate 2025: Register Today!

 

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 1878 views
  • 3 likes
  • 3 in conversation