Hi ballardw, Thank you so much . SELECTALL option is working for me and it is taking the sample size avaliable in dataset if it is less than the sample size given in programme. Thanks But still I am struggling for strata group. If you see my code I have commented many strata group because sometimes this are not avaliable in input data set but not always . it menas ne next run it might happen i have to uncommented some of the strata group from the comment. Basically the queston is " How can I sample from some of the strata in my data while ignoring others? " For example : %let rcanum1= 5180; %let rcanum2= 4776; %let rcanum3= 3240; %let rcanum4= 5064; proc surveyselect data = work.claima sampsize = (&rcanum1., &rcanum2., &rcanum3., &rcanum4.) method = srs out = work.samplea SELECTALL; strata group; run; In next run "&rcanum2" is not avliable like : %let rcanum1= 5180; %let rcanum3= 3240; %let rcanum4= 5064; I dont wnat to go & correct teh code by deleting the value from sample size & will again run .. the code should automatic check & provide me output without warning & error for 3 group. is there any option ?? Hope you understand ! Thanks in advance. Cheers,
... View more