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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 659 views
  • 0 likes
  • 2 in conversation