Please provide a PROC CONTENTS and a PROC PRINT (of the first 10 observations) of your new DEBT_DATA data set so we can determine the cause of the problem.
@dw_sas was right in his suggestion of how to fix your problem.
But you still have a few issues in your code.
Do not use the same data set name and the SET name. It makes it really hard to debug your code, is confusing and bad practice.
data data;
set data;
You have a year variable which is numeric and represents a year, as 1994, 1995. It is not a SAS date.
For some reason you think you need to loop - SAS does this automatically so it's a single line of code to create your year variable.
%let start=1983;
%let end=2017;
data data;
set data;
format date year4. ;
date = "01jan&start."d;
do until (date > "01jan&end."d);
output data;
date = intnx('year',date,1);
end;
run;
When I imported the data there were some empty rows and columns, I deleted them.
I changed the variable name from date to myDate to make the code more clear.
The problem was in date function when i verified my data i found that the ancient date function create date from 1983 to 2017 but for each debt's value
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.