This SAS Jedi is very excited about the SAS 9.4 M4 release, which brought many wonderful gifts just in time for Christmas. So in the interest of extending the Christmas spirit, I'm going to blog about some of my favorites!
I've long loved the SAS DO statement variant which allows iterating over a discrete list of values:
data test; call streaminit(12345); do Month='Jan','Feb','Mar'; Revenue = round(rand('NORMAL',1000,100)); output; end; format Revenue dollar8.; run;
Until now, this has only been available in the traditional SAS DATA step. Neither DS2 nor SAS Macro had this feature. And every time I teach the DS2 class, I've had to say it wasn't available in DS2, but was on my wish list. Well, with the M4 release of SAS, I don't have to wish anymore! :-)
proc ds2; title 'DS2 Results'; data; dcl char Month; dcl int Revenue having format dollar8.; method init(); streaminit(12345); do Month='Jan','Feb','Mar'; Revenue = round(rand('NORMAL',1000,100)); output; end; end; enddata; run; quit;
So Merry Christmas from SAS! As usual, you can download the code for this episode from HERE.
And may the SAS be with you in the New Year!