/***************************************************************************************************************** SAS file name: nth_obs.sas File location: __________________________________________________________________________________________________________________ Purpose: To demonstrate how to extract every n'th observation in a SAS Data Set Author: Peter Clemmensen Creation Date: 18/03/2020 This program supports the blog post "Extract Every N'th Observation From a SAS Data Set" on SASnrd.com *****************************************************************************************************************/ /* Use the Point= Option in the Set Statement */ data point; do point = 10 to nobs by 10; set sashelp.shoes point=point nobs=nobs; output; end; stop; run; /* Use the MOD Function */ data mod; do point = 10 to nobs by 10; set sashelp.shoes point=point nobs=nobs; output; end; stop; run; /* With Proc SQL */ Proc SQl; Create table sql as select * from sashelp.shoes where (mod(monotonic () ,10))=0; quit;