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

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

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