BookmarkSubscribeRSS Feed
swayto
Fluorite | Level 6

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?

2 REPLIES 2
andreas_lds
Jade | Level 19

Run the code, look at the log, the answer will be there. Or: Read the documentation of qtr and do the calculation yourself.

Shivam
Calcite | Level 5

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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 505 views
  • 0 likes
  • 3 in conversation