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 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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