Hi,
I am facing a challenge in getting two date values like Year and Week to be concatenated as YearWeek.
For example:
Year=2015
Week number = 1 To 52
Result needed is a new varaible "Year_Weeknumber" = 201501, 201502 etc. in this format, displaying year and week number.
I have the year and weeknumber calculated in SAS from dates, but unable to concatenate them.
I am able to have yearMonth, YearQuarter values from date using Format, but did not find "Year Weeknumber" option there.
Regards,
Abhi
If numeric use math
var=year*100+week;
if if you want a Character use catt
var=catt(year, put(week, z2.));
If numeric use math
var=year*100+week;
if if you want a Character use catt
var=catt(year, put(week, z2.));
Thank you so much Reeza..It works !!!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.