Firstobs option with Proc Sql? Firstobs option with Proc Sql? 6656 (Programmer) (OP) 26 Mar 03 09:25 Hi, Does anyone know that there are the same function (firstobs=5 obs=100)in data option for proc sql? Thanks,Mike RE: Firstobs option with Proc Sql? Queryman (Programmer) 26 Mar 03 14:39 Seeems like firstobs will denote the obs in the dataset and obs will denote the number in the result set. Michael RE: Firstobs option with Proc Sql? teralearner (TechnicalUser) 26 Mar 03 16:43 inobs = option will limit number of observations retrieved from passthrough sql;like :proc sql inobs = 100;..... RE: Firstobs option with Proc Sql? teralearner (TechnicalUser) 27 Mar 03 14:00 Alright, PROC SQL has inobs and outobs options. There is not equivalent option as firstobs. But you can still use firstobs and obs option in PROC SQL:proc sql;create table TWO asselect *from ONE(firstobs = 11 obs = 20);quit;You get 10 observations back. RE: Firstobs option with Proc Sql? jymm (Programmer) 28 Mar 03 08:46 or you can always go back to 'old school' SAS (before Proc SQL) just use _N_ to figure out which record you are on and output accordingly. (for those of you that do not know - _N_ is the observation variable that you do not see - unless looking for it)so :data one;set ODBCDATABASE.TABLENAME;If _N_ >= 5 & _N_ <= 105 Then Output;(in one client job I have also been known to sort the data and then get just the even numbered records in a range for a sample)I still say that Proc SQL was put there for SQL DBAs like me --- but you can do MANY things with SAS data steps that you can not easily in SQL.