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.  


 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

LIBNAME 101

Follow along as SAS technical trainer Dominique Weatherspoon expertly answers all your questions about SAS Libraries.

Find more tutorials on the SAS Users YouTube channel.

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