Hello Everyone, I'm scratching my head at this problem. Here's what I'm trying to do: 1. Use cats to create a concatenation between a calculated Month, a delimiter, an arbitrary day (15 in this case), and a calculated two digit year. I then use the input function on this to force it to MMDDYY10. format, but I keep getting 21564, not 01/15/2019 as I intended. 2. The string date is shown next to the formulaically derived date. proc sql;
create table example2 as
select * from
(select
put(&YYMM.,Best4.) as YYMM,
Acct_No,
sum(Balance) as BalAmt,
avg(Balance) as Avg_Bal_Amt,
avg(Mon_Var) as Month,
cats(calculated Month,"/",15,"/",substr(calculated YYMM,1,2)) as Date,
input(cats(calculated Month,"/",15,"/",substr(calculated YYMM,1,2)),MMDDYY10.) as Date2
from example1
);
run;
quit; The output is shown like so: Date (str) Date2 (Num) 1/15/19 21564 1/15/19 21564 1/15/19 21564 1/15/19 21564 Mon_Var is simply the month number such as 1, 2, 3, etc (an integer). YYMM is a macro that is predefined. In this case, it is 1901 (a string). I am, in effect, trying to take an arbitrary day like 15, and create a date out of this YYMM variable, but to no avail. Any help is appreciated! -Valentine
... View more