Next time please add your code as a text attachment - this way it's much easier for us to scroll through this thread - and if it's DI then it should be in the "data management" section. Looking into the DI generated code the very first time you reference "snapshot_id" you set it %global and there is no %local statement anywhere in the code. There is also no "rsubmit" or anything like this so all your code runs in a single session. This means "&snapshot_id" should always be available on global level no matter where you set the value. You don't really tell us what the problem is but just scanning through your code I can see that you populate "snapshot_id" twice but with different values. %let snapshot_id = 20171231; %let snapshot_id = 20161231; So I assume you don't really get an error but an unexpected result - which could well be caused by populating "snapshot_id" twice but with different values.
... View more