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-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

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