我是 SAS 的新手,并且在 sql 中有最新的代码,我已经被困了一段时间才能在 SAS 平台中转换它。我也尝试在 SAS 中使用 do..while 循环,但它没有用。
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;