Help using Base SAS procedures

DATA STEP

Reply
Super Contributor
Posts: 1,041

DATA STEP


hi,

For ex i have 4 records in a dataset.

data demog;

set have;

run;

Have dataset has these 4 records

name  age 

kevin   23

peter   28

louis   33

...

...

...

first the Input buffer is set blank or missing accordingly.

it reads the first observation writes to the dataset

It then goes to the beginning of the datastep. NOW  how will SAS know  that it has already read the first one AFTER RETURNING TO THE BEGINNING OF THE DATA STEP????

Could someone tell me the process how it works??????

Super Contributor
Posts: 1,041

Re: DATA STEP

Posted in reply to robertrao

Sorry about that,,,I went back to my Basics and learnt that it is because of the _n_=

Super User
Super User
Posts: 7,050

Re: DATA STEP

Posted in reply to robertrao

Try running this little step to see how it works in more detail.

data new;

  put 'BEFORE ' _n_= age= eof=;

  set have end=eof ;

  put 'AFTER  ' _n_= age= eof=;

run;

Ask a Question
Discussion stats
  • 2 replies
  • 134 views
  • 0 likes
  • 2 in conversation