data null;
format dt date9.;
d=put(month(today())-2,z2.);
if month(today())=1 then e=put(year(today())-1,4.);
else e=put(year(today()),4.);
f=e||d;
dt=input(put(f,6.),yymmn6.);
call symput ('Snapshot_date',intnx('month',dt,0,'e'));
run;
data null;
call symput ('L1M',put(intnx("month",&Snapshot_date,-1,'e'),date9.));
call symput ('L3M',put(intnx("month",&Snapshot_date,-3,'e'),date9.));
call symput ('L6M',put(intnx("month",&Snapshot_date,-6,'e'),date9.));
call symput ('L1Y',put(intnx("month",&Snapshot_date,-12,'e'),date9.));
call symput ('rpt_dte',put(&Snapshot_date,date7.));
call symput ('monyy',propcase(put(&Snapshot_date,monyy5.)));
call symput('Rbase2',put(intnx('month',&Snapshot_date,0,'e'),yymmddn8.));
run;
%put &Snapshot_date &L1M &L3M &l6M &L1Y &monyy &Rbase2;
Output#
19843 31MAR2014 31JAN2014 31OCT2013 30APR2013 Apr14 20140430
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.