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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

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
  • 2 replies
  • 395 views
  • 0 likes
  • 3 in conversation