How to create a data set out of this question?
Data work. report;
Set work.sales;
If qtr(Sales_Date) GT 2;
run;
The SaS data set work.sales has 1 observation for each month in the year 2007 and the variable sale_Date contains a SaS date value for each of the 12 months.How many of the original 12 observations in Work.Sales are written to work.report data set?
Run the code, look at the log, the answer will be there. Or: Read the documentation of qtr and do the calculation yourself.
I assume your base dataset has 12 entries for all the 12 moths.
as per your code the output data should have 6 records, but you can obviously check it in log as well and check the values which are being returned by qtr function
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.