BookmarkSubscribeRSS Feed
podarum
Quartz | Level 8

I need help from some proc expand experts

I have data that has date and units by quarter.. I want it to expand it by month but when the total for the year (by 12 months)  is added up it remains the same as the 4 quarters.

have

2000.Q1  33

2000.Q2  22

2000.Q3  50

2000.Q4  10

want

2000.01 11

2000.02 10

2000.03 12

2000.04   2

2000.05   5

2000.06  15

and so on...

so in the 'want' the sum for the 2000.01 & 2000.02 & 2000.03 remain 33 as per before.

Thanks

2 REPLIES 2
data_null__
Jade | Level 19

Maybe,

data test;

   input date:yyq. y;

   format date yyq.;

   cards;

2000Q1  33

2000Q2  22

2000Q3  50

2000Q4  10

;;;;

   run;

proc print;

proc expand to=month extrapolate method=step;

   id date;

   convert y / tout=(/3);

   run;

proc print;

   run;

art297
Opal | Level 21

This post was just shown as a new post even though it is a month old.  Surely someone must have asked the obvious questions: (1) does it HAVE to be done with proc Expand? and (2) what determines the proportion of the split for each month?

If you only need quarter expanded to month, and the percents to be equally split between the three months, and it can be accomplished in a datastep, the task is trivial.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

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