Thanks @pchegoor
That is very exciting news. Maybe enough for me to renew my personal AWS subscription so I can play with this a bit in university edition (probably still a couple months away from having 9.4M4 at work).
The management of the DOSUBL side-sesssion environment / inheritance (not only macro variable scope, but system option scope, etc... ) must be very complex. I'm glad they have fixed this macro variable collision. Hope to be playing with it soon.
There's such amazing potential in DOSUBL, I'm glad they're putting in the development effort for fixes.
@Quentin On a slightly different Topic. I wonder why you need AWS for SAS University Edition. You can directly download it on your Machine instead of using it via the cloud on AWS and save money on the subscription. Also if you prefer a Cloud based version of Free SAS Software then you do have the SAS On Demand for Academics . This one has SAS/GRAPH included too plus additional SAS products. The Comparision of SAS On Demand for Academics and SAS University Edition is given here
Right now SAS On Demand for Academics this is still at 9.4M3 but i am hoping by the end of Jan 2017 or so it may be also be updated to 9.4M4 . May be @AmyP_sas can comment on when this may occur.
I'm having a problem which I think MAY be related to this bug but I'm not sure because I'm venturing into new SAS coding territory!
I'm using a combination of PROC STREAM, a macro template to spit out XML, and inside the template calling a macro that has a logic to set a global variable which will get used after the dosubl call.
/** Something similar to this **/
proc stream outfile=REQUEST
begin%due_date_template(...)
;;;;
run;
.
.
.
/** sub section of the due_date_template macro **/
%do i=1 %to &numAlerts;
.
.
%let rc= %sysfunc(dosubl('due_date_macro(var1,var2,var3...)'));
.
.
.
/** inside the due_date_macro, there is logic to set a global variable called
due_date
**/
%put due_date = &due_date;
%end;
/**
1st time through the due_date gets set properly
the remaining times in the iteration the due_date remains the initial value set
by the dosubl call even though a new due_date is being calculated.
**/
Is this part of the bug in M3? I've tried everything to get that &due_date macro to update after the dosubl call but it always remains the first value set!
-Matt
Yes it looks like it is due to the DOSUBL bug in 9.4M3 .
I ran the below code both on 9.4M3 and 9.4M4 :
%macro due_date_macro(flag);
%Put &=flag;
%Let due_date=&flag;
%Put INNER : &=due_date;
%mend due_date_macro;
%Let Due_Date=;
%Let Var1=20120304;
%Let Var2=20120805;
%Let Var3=20150709;
%Macro Test;
%do i=1 %to &numAlerts;
%let rc= %sysfunc(dosubl('%due_date_macro(&&Var&i)'));
%put OUTER : &=due_date;
%put **************************;
%end;
%Mend Test;
%Let NumAlerts=3;
%Test;
Result from SAS 9.4M3:
Result from SAS 9.4M4 :
62 %macro due_date_macro(flag);
63
64 %Put &=flag;
65
66 %Let due_date=&flag;
67
68 %Put INNER : &=due_date;
69
70 %mend due_date_macro;
71
72
73 %Let Due_Date=;
74 %Let Var1=20120304;
75 %Let Var2=20120805;
76 %Let Var3=20150709;
77
78
79 %Macro Test;
80
81 %do i=1 %to &numAlerts;
82
83 %let rc= %sysfunc(dosubl('%due_date_macro(&&Var&i)'));
84
85 %put OUTER : &=due_date;
86 %put **************************;
87 %end;
88
89 %Mend Test;
90
91
92 %Let NumAlerts=3;
FLAG=20120304
INNER : DUE_DATE=20120304
93 %Test;
OUTER : DUE_DATE=20120304
**************************
FLAG=20120805
INNER : DUE_DATE=20120805
OUTER : DUE_DATE=20120805
**************************
FLAG=20150709
INNER : DUE_DATE=20150709
OUTER : DUE_DATE=20150709
**************************
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.