I am rewriting code from oracle sql to sas proc sql and I have problem with this:
where demandes_fin.per_idt = to_char(add_months(to_date(fin.per_idt,'yyyymm'),1),'yyyymm'))
demandes_fin.per_idt and fin.per_idt are INT variables - for example 201612.
functions to_char, add_months, to_date are not working in SAS proc sql. I have tried to replace them using put, input, intnx, format but it didn't work as I expected.
I have tried to put this code in select statement to see values, that was generated:
intnx('month', input(put(fin.per_idt,6.),yymmn6.), 1) as dt1
fin.per_idt was 201701 and generated value was 20851.
Do you have any ideas how to code it?
Thank you so much.