Your best choice is using SAS Macro variables. This is just one example. There are other ways of creating macro variables.
select nobs into :cntobs
where libname = "SASHELP" and
memname = "CLASS";
%let cntobs = &cntobs;
%put cntobs= &cntobs is the number of obs in SASHELP.CLASS;
retain divideby &cntobs;
newnum = sales / divideby;
proc print data=new (obs=5);
title "Using the Number of Obs ( &cntobs ) from CLASS to divide by in SHOES";
var region product sales divideby newnum;
If you need more help understanding what this program is doing or how to use SAS Macro variables or if this examples does not suit your needs, your best bet for help is to contact SAS Tech Support.