11-12-2013 05:11 PM
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.
11-13-2013 08:32 AM
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.