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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

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