Seeing as you necro'd an old thread, I thought I would point out:
SAS Creates macro variables at the end of each step:
https://documentation.sas.com/?cdcId=vdmmlcdc&cdcVersion=8.1&docsetId=mcrolref&docsetTarget=p0t267pk8lwx3en1gn9fywjgni8y.htm&locale=en
And SQL is sqlobs.
So if you need it inline with your code then you can use that after the step. If you need observations elsewhere for some reason, then there is the SASHELP.VTABLE view which holds observations for all data tables (except external linked databases), so you can always get the obs from there. Depends on what you need it for. Rarely useful to recreate to have your own macro variables.
... View more