BookmarkSubscribeRSS Feed
ari2495
Obsidian | Level 7

HI, i'm trying to understand a code, i found the following:

data Db_1;
set db;
variable= variable*(-1) ;
run;

what could be the reason? i can't understand this data step

1 REPLY 1
PaigeMiller
Diamond | Level 26

You could actually try running the code and seeing what happens with your own eyes, does the value of VARIABLE change? What does it change to?

 

But let me ask another question — forget SAS for a moment, just answer based upon what you have learned about math in your life — what do you get if you multiply a number, let's say the number 5, by -1 ? Do this in your head or on paper, what do you get?

--
Paige Miller

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

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