BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi folks!

I´m trying to perform a division using an array.
The information I have are in columns and I wanna change then to line at same divide them.

Example raw file:

Date - Var1 - Var2 - obs
Jan/06 - 200 - 1000 - 1
Jan/06 - 300 - 1000 - 2
Jan/06 - 400 - 1000 - 3
Jan/06 - 500 - 1000 - 4

after process the desirable result (Var1 / Var2) follow as show bellow

jan/06 - 0.2 - 0.3 - 0.4 - 0.5

Thanks Message was edited by: Carlos
1 REPLY 1
advoss
Quartz | Level 8
Try something like:
Data Step2;
set step1;
result = var1/var2;
run;
proc transpose data=step2 out=step3(drop=_:) prefix=Result;
by date;
var result;
id obs;
run;
proc print data=step3;
run;

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Early bird rate extended! Save $200 when you sign up by March 31.

Register now!

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