Current location - Loan Platform Complete Network - Big data management - How to select certain data rows in sas dataset to form a new dataset
How to select certain data rows in sas dataset to form a new dataset
Depends on your selection criteria.

1. Select based on the number of rows:

data test;

set oldset;

if _n_=10 then output;

if id="001" then output;

run;

Output the 10th data row and the data row with id="001" and form the data set test;

Output the 10th data row. row and id="001" and form the data set test;

2. use where statement

3. use a combination of firstobs and obs to intercept a portion of the data rows

data test;

set oldset(firstobs=10 obs=1000);

run;