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

 

Secure your spot at the must-attend AI and analytics event of 2024: SAS Innovate 2024! Get ready for a jam-packed agenda featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.

 

Register by March 1 to snag the Early Bird rate of just $695! Don't miss out on this exclusive offer. 

 

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