1
我在SAS中是一個新手,並且在sql中有最新的代碼,我已經被暫停了一段時間來在SAS平臺上進行轉換。我也嘗試在SAS中做do..while循環,但它不起作用。嵌套for ...循環在SAS
for c in (select * from risk.mv_closed_deals d) loop
for DatesToInsert in (select distinct(T1.ACTUAL_DATE) as ACTUAL_DATE from VINTAGE_MTD T1 where T1.Actual_Date>c.closed_date) loop
insert into VINTAGE_MTD (dealdate, actual_date, deal_month, mob, dealno, balance, loanamount, overduedays, status, server)
values (c.issue_date, DatesToInsert.Actual_Date, to_char(c.issue_date,'yyyy/mm'),
(to_char(DatesToInsert.actual_date,'yyyy')-to_char(c.issue_date,'yyyy'))*12 + to_char(DatesToInsert.actual_date,'mm') - to_char(c.issue_date,'mm') - 1,
c.dealno, 0, c.loanamount, 0, 0, 'B2');
end loop;
end loop;
你能告訴我們你的錯誤嗎? – Beta