Hi @james_peacock and welcome to the SAS Support Communities!
In many DATA steps the value of automatic variable _N_ coincides with some observation number. But there are many exceptions to this rule of thumb because in fact _N_ doesn't enumerate observations, but iterations of the DATA step (see Overview of DATA Step Processing and for automatic variables in general: Automatic Variables).
Here are some examples (note that PUT statements write to the SAS log by default):
/* Read 19 observations: _N_ and observation number coincide */
data _null_;
set sashelp.class;
put _n_=;
run;
/* Make 20th DATA step iteration visible */
data _null_;
put _n_=;
set sashelp.class;
run;
/* Read and write 19 obs. within a single iteration of the DATA step: _N_=1 */
data test;
do until(0); /* (no infinite loop thanks to SET statement) */
set sashelp.class;
output;
put _n_=;
end;
run;
/* Create dataset from data lines: _N_=1, 2, 3 */
data a;
input x;
put _n_=;
cards;
10
20
30
;
/* Create same dataset from same data lines, but within
one iteration of the DATA step: _N_=1 */
data a;
input x;
output;
input x;
output;
input x;
output;
put _n_=;
cards;
10
20
30
;
/* No datasets involved, still _N_=1 */
data _null_;
put _n_=;
run;
/* _N_ can be "mis"used for other purposes (here: as an index variable
of a DO loop that is dropped automatically). It's not read-only. */
data squares;
do _n_=1 to 5;
square=_n_**2;
output;
end;
run;
If your example refers to the UNIFORM function, using uniform(_N_) is possibly questionable or misleading (depending on the context) not only because this function is deprecated, but because multiple calls of the function with varying values of _N_ in the same DATA step always use the same seed value.