Just a tad curious what you will do when crossing a year boundary, where one string is not in the same year as the other?
Suggest you still take in the two macro variables but drive the %DO / %END process using SAS DATE values represented as macro variables, and then truncate the output format of your low "yymm" and high "yymm" data strings as needed.
This would mean using %SYSFUNC and PUTN / INPUTN to convert the yymm to yymm01, using INPUTN and then use PUTN, if needed, to generate a truncated DATE variable string. You will need to consider using the INTNX function for your processing, possibly.
Some examples:
%LET YYMM = 0905;
%LET MYDATE = %SYSFUNC(INPUTN(&YYMM.01,YYMMDD.));
%LET MYDDMMYYYY = %SYSFUNC(PUTN(&MYDATE,DATE7.));
%LET MYYYMM = %SYSFUNC(PUTN(&MYDATE,YYMMN4.));
%PUT _USER_;
Scott Barry
SBBWorks, Inc.
... View more