BookmarkSubscribeRSS Feed
SAS_newbie1
Calcite | Level 5

Hi

I'm new to SAS and am using SAS Enterprise Guide 4.3.  I have a project that produces several outputs based on dates between first of the month and last of the month for the previous month.  This will eventually be changed to first of the quarter and last of the quarter. All queries come from one user defined table with text, date and number columns.  The outputs are tables of raw data and counts of the data by specific key words.

I have hard coded the dates to get the project running, and now I need to change the dates to variables.  I'm finding SAS dates quite confusing and am not sure how to write this - I think somehow via computed columns?  Can anyone help?  I want this to run automatically and without user interaction on the first day of the month to pull information for the previous month.  This will later be changed to the first day of the quarter to pull information from the previous quarter.

thanks

1 REPLY 1
ChrisHemedinger
Community Manager

This question is marked "Assumed Answered".  Is it?  Did you get what you needed?

You can calculate relative dates with a collection of SAS functions: DATE, TODAY, MDY, INTCK, and more.  You can also use SAS formats to help "bucket" your data for easy aggregation.  The specific solution for you depends on your data and exact query, but I'm sure if you post more details others will offer suggestions.

More reading:

Do you mind if we dance with your DATEs (or DATETIMEs)? - The SAS Dummy

Chris

SAS Innovate 2025: Call for Content! Submit your proposals before Sept 25. Accepted presenters get amazing perks to attend the conference!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 2359 views
  • 0 likes
  • 2 in conversation