AirNav
don't know if you're still interested, but since I've something similar, thought I might offer the code below.
Assumptions:
1 : the -12 through 11 are variable labels (to be replaced with "month year" dates)
2 : for demonstration purposes, I assume your data is in a table named in macro variable &_data_1
3 : the header of that data set can be updated (a fairly high level of privilege)
* create data with the required columns for testing ;[pre] %let _data_1 = your_data ;
data &_data_1 ; retain m1-m24 . ;
label m1='-12'
m2='-11'
m3='-10'
m4='-9'
m5='-8'
m6='-7'
m7='-6'
m8='-5'
m9='-4'
m10='-3'
m11='-2'
m12='-1'
m13= 'Current Month'
m14= '1'
m15= '2'
m16= '3'
m17= '4'
m18= '5'
m19= '6'
m20= '7'
m21= '8'
m22= '9'
m23= '10'
m24= '11'
;
run;
proc contents data= &_data_1 noprint out= _data_ ;
run ;
data _null_ ;
if _n_ = 1 then do ;
set &syslast ;
call execute( 'proc datasets nolist lib= '!! libname ) ;
call execute( '; modify ' !! memname !! '; label ' ) ;
end ;
set &syslast end= finished ;
oLabN = input( label, ?? 12. ) ;
if label='Current Month' then lab= put( today(), nlDateYM. );
else if ( -12 LE oLabN LE 11 ) then
lab = put( intnx( 'month', today(), oLabN ), nlDateYM. );
call execute( name !! '= ' !! lab ) ;
if finished ;
call execute( '; run ; quit ;' ) ;
run ;[/pre]
null