Can you post the log (at least the log snippet for the code shown)? Your program has that DATA step, followed immediately by the two %PUT statements?
I would look for an error in the log prior to this point. When scheduled jobs run, SAS will (by default) enter syntax check mode when an error occurs. If an error occurred earlier in the session, and SAS entered syntax check mode, then the DATA step would not execute, so the macro variables would not be created. But I believe the %PUT statements would still execute.
The code you showed is fine, so the problem must be somewhere else.
... View more