ods html close;
ods listing;
data foo;
input Product UPC Form Type Week1 Week2 Week3 Week4 Unit1 Unit2 Unit3 Unit4;
cards;
01 01 01 01 05 06 07 08 09 10 11 12
02 02 02 02 21 22 23 24 25 26 27 28
01 01 01 01 13 14 15 16 17 18 19 20
02 02 02 02 29 30 31 32 33 34 35 36
;
run;
proc sort data=foo;
by Product UPC Form Type;
run;
data bar;
set foo;
by Product UPC Form Type;
array W[4] Week1-Week4;
array U[4] Unit1-Unit4;
do i=1 to 4;
Week=W;
Unit=U;
index=i;
output;
end;
drop i;
drop Week1 Week2 Week3 Week4;
drop Unit1 Unit2 Unit3 Unit4;
run;
proc print data=bar;
run;
Message was edited by: scmebu
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.