If you are wanting to capture a SAS variable value and make it available in another DATA step (or somewhere in your current SAS session), you will need to look at using CALL SYMPUT. Then, with the SAS global macro variable assigned, you can reference that macro variable elsewhere in your current SAS session. It is important to learn and understand how SAS macro variables are accessed, assigned, and referenced in the different parts of the SAS system, particularly SAS macro based programs, SAS DATA step variables (through an assignment or RETAIN statement), and as a constant/literal value in a SAS language expression / statement.
Scott Barry
SBBWorks, Inc.
Suggested Google advanced search arguments, this topic / post:
macro variable introduction site:sas.com
macro variable scope symput site:sas.com
resolving macro variables in code site:sas.com
macro variable debugging site:sas.com
macro variable symbol resolution site:sas.com