In reply to Shunrui.

You can't share a macro variable that's set in one SAS session with another SAS session (that called it via SYSTEM), but maybe you can set an environment variable in the one script and read it from the SAS program with SYSGET?