BookmarkSubscribeRSS Feed
NareshAbburi
Calcite | Level 5

Hi,

I'm forecasting a variable on a weekly basis. But my requirement is daily basis. So I'm forecasting for one week and dividing that value into 7 parts for the successive dates.

My question is how do I create 6 more rows with different dates using one row data.

Please refer to the attached pics:

first one is Current Output and the next one is required output.

Kindly throw some light.

Thanks,

Naresh

BELTWAY REGIONCDVCONNECTBUSINESSQTY5/3/2015.442.1057
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/10/2015.421.6068
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/3/2015.442.1057
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/4/201563.15795
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/5/201563.15795
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/6/201563.15795
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/7/201563.15795
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/8/201563.15795
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/9/201563.15795
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/10/2015.421.6068
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/11/201560.22954
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/12/201560.22954
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/13/201560.22954
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/14/201560.22954
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/15/201560.22954
BELTWAY REGIONCDVCONNECTBUSINESSQTY5/16/201560.22954
1 REPLY 1
slchen
Lapis Lazuli | Level 10

data have;

input (v1-v6)($) date mmddyy10. num;

format date mmddyy10.;

cards;

BELTWAY REGION CDV CONNECT BUSINESS QTY 5/3/2015 442.1057

BELTWAY REGION CDV CONNECT BUSINESS QTY 5/10/2015 421.6068

;

run;

data want(rename=(_num=num _date=date));

   set have;

   do i=0 to 6;

      if i=0 then do;

      _date=date;

  _num=num;

  num=num/7;

  output;

    end;

    else do;

       _date=intnx('day',date,i);

   _num=num;

   output;

  end;

  end;

  format _date mmddyy10.;

drop num date i;

run;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 1146 views
  • 0 likes
  • 2 in conversation