5 is neumeric variable. Why do we need to put single quote for 5?SAS 2 lesson 4.5.8

10 views
Skip to first unread message

Thirumagal manivannan

unread,
Aug 16, 2014, 12:34:44 PM8/16/14
to anova...@googlegroups.com
Hi,
5 is neumeric variable. Why do we need to put single quote for 5?
SAS 2 lesson 4.5.8

code.


data correct;
set orion.clean_up;
if find (product, 'Mittens' 'I') >0 then do;
substr (Product_ID, 9, 1)='5';
end;
run
For 5 neumeric variable, why do we need to put single quotes.docx

Anova Groups

unread,
Aug 17, 2014, 2:30:28 AM8/17/14
to anova...@googlegroups.com
My home street address is
517 willow thicket ct

Now 517 is part of a text and so even though it is a number, it is treated as text. So a number can be a numeric or character depending on the context in which it is used.

If context is numeric 5 (or any number) you don't need single quotes, if context is character we have to put five in single quotes '5'.

In your example product_id is a character variable and so the context is character. Hope this help.
Reply all
Reply to author
Forward
0 new messages