No, it doesn't work like that. SAS's definition of arrays is unlike most (all?) other languages. All it does is set a template over a collection of variables: there is no space allocated as such by the array statement (I will defend this against all comers!).
So when you define an array, you have to set the bounds of the array dimensions. When you use the _numeric_ or _char_ special variable names, you're assigning the array in only one dimension. WIthin the brackets you can set either the numeric bounds or, as you've done in your first example "*", to let the SAS parser pick up the bounds from metadata.
So your second example won't work for two reasons:
the array bounds must be numeric constants (not variables) or *.
Even having variables i and j in work.dataset (and having variables called that in a dataset is never a good idea!) won't work, because they're not constants.
_numeric_ is inherently one-dimensional. It is possible to treat it as multi-dimensional, but doing that would be fraught with difficulty; I would never recommend it because you have very little control over the order in which your variables are referenced.
... View more