Can I use the automatic variables _n_ and _error_ in PROC steps?

We are used to using the automatic variables _n_ to identify the iteration count, or the boolean _error_ variable to identify data / logic errors when performing DATA step processing.

The same variables are not available to us in PROC steps.

While the code:

data part ;
  set sashelp.class ;
    where _n_ > 4 ;
run ;

will work, the code:

proc print data = sashelp.class ;
  where _n_ > 4 ;
run ;

will not.


Alan D Rudland
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.

Records in this category