BookmarkSubscribeRSS Feed
Steelers_In_DC
Barite | Level 11

I have two pieces of code that I only want run in January.  Currently they are running every month which is fine but very ineffiecient.  I am saving history by month for the current year and the december file for the three previous years.  The second code is only taking last december data.  I set it up this way so the end user doesn't have to change anything or have any extra steps.  BUT, I'd like to set it up so this piece of code only runs in January.  Any help will be appreciated.

Thank You,

data testhistory;

set testhistory;

where year(reporting_date) = year(&yeardate) or

          reporting_date = &yeardate11 or

          reporting_date = &yeardate22 or

          reporting_date = &yeardate33;

run;

data testdec;

set testdec;

where reporting_date = &yeardate11;

run;

1 REPLY 1
RichardinOz
Quartz | Level 8

where month(reporting_date) = 12

Richard

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 309 views
  • 0 likes
  • 2 in conversation