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-wordmark-gradient-background 3.pngSAS Innovate

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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
  • 1919 views
  • 0 likes
  • 3 in conversation