והנה זה בגרסת ה LUA
proc lua restart;
submit;
local from_ym = '201901'
local to_ym = '202103'
months = sas.intck('month', sas.inputn(from_ym, 'yymmn6.'), sas.inputn(to_ym, 'yymmn6.'))
for i = 0, months do
curr_ym = sas.put(sas.intnx('month', sas.inputn(from_ym, 'yymmn6.'), i), 'yymmn6.')
print (curr_ym)
-- Insert here the macro call or other code we need to loop around on with the CURR_YM parameter
-- For example
-- sas.submit([[ title "@curr_ym@"; proc print data=sashelp.class;run; ]])
end
endsubmit;
run;
כפי שניתן לראות אפשר להשתמש בפונקציות SAS בתוך קוד LUA (שהופעל מתוך SAS...)
... View more