25 users online | 25 Guests and 0 Registered

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.

 

Author:
Alan D Rudland
Revision:
1.0
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.

Records in this category

Tags