Hello, I am having trouble assigning macro variables that work within the proc sql into function. When I run the code below, the assignment of the macro variable sort of "cuts off" at year, such that the macro variable follows the assignment shown in the picture below. Although when I use the basic %let way of assignment, it works fine. PROC sql;
SELECT DISTINCT
CASE
WHEN month("&ReportDate"d)=12 THEN "('CY 1st Half','CY 2nd Half')"
WHEN month("&ReportDate"d)=6 THEN "('CY 1st Half')"
END
AS period,
CASE
WHEN month("&ReportDate"d)=12 THEN "YE"
WHEN month("&ReportDate"d)=6 THEN "MY"
END
AS period2,
strip(calculated period2) as period3,
strip(substr(compress(tranwrd(put(intnx('qtr',"&ReportDate"d,-1,'E'),yymmdd10.),"-","")),1,4)) as year
into : Period, : Period2, : Period3, : Year
FROM _PRODSAVAIL;
quit;
%let libname = \\BPR\BPR 2.0 (New BPR)\Data\&year.\&period3;
... View more