Hi, I am trying to create a header for my table that reads "2023 Actual."
The purpose of this is to compare what we spent in the prior year compared to the current year.
My program prompts the user for the current year as a 4 digit numeric variable called "Vyear" which is the current year, or 2024 in this example.
As of now, when I run the attached code the header reads as "2024-1 Actual" as text. (see attached image). My goal is to have the header "2023 Actual"
I made the current year as numeric to avoid having to create an additional prompt that asks for what year it was last year in hopes that I could do Vyear(current year) -1 to return the prior year. Ex: 2024 would become 2023.
%put &VYear;
%let VP = &Vyear. - 1;
%put &VP.;
%let VYearChar = %sysfunc(putn(&Vyear, 4.));
%let Budget = "&VYearChar. Budget";
%let Actual = "&VYearChar. Actual";
%let V_Act = "&VP. Actual";
DATA Work.BotL;
Set WORK.Month_PYtoCYActuals;
Header = &V_Act.; MTD = 'PY Month Actual'n; OUTPUT;
Header = &Actual.; MTD = 'CY Month Actual'n; OUTPUT;
Header = 'Variance $'; MTD = '$ Variance'n; OUTPUT;
drop 'PY Month Actual'n;
drop 'CY Month Actual'n;
drop '$ variance'n;
RUN;
DATA Work.BotL;
Set WORK.Month_PYtoCYActuals;
Header = &V_Act.; MTD = 'PY Month Actual'n; OUTPUT;
Header = &Actual.; MTD = 'CY Month Actual'n; OUTPUT;
Header = 'Variance $'; MTD = '$ Variance'n; OUTPUT;
drop 'PY Month Actual'n;
drop 'CY Month Actual'n;
drop '$ variance'n;
RUN;