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

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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