BookmarkSubscribeRSS Feed
anming
Pyrite | Level 9
data work.retail;
cost = (20000);
total = .10 * cost;
run;

to assign a value to cost, 20000 or (20000) both work. "20000" or '20000' also work but a log note shows that a char is changed to a numeric value.  

1 REPLY 1
Reeza
Super User

Yes, because a value in quotes is considered a character value so SAS converts it to a number before it can do math on the value.

 


@anming wrote:
data work.retail;
cost = (20000);
total = .10 * cost;
run;

to assign a value to cost, 20000 or (20000) both work. "20000" or '20000' also work but a log note shows that a char is changed to a numeric value.  


 

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!

5 Steps to Your First Analytics Project Using SAS

For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 515 views
  • 2 likes
  • 2 in conversation