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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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