Hi all, i have one variable, 'zcta'. it has 5 digit value and 4 digit value but i want to pull up information where 'zcta' has only 4 digit. How can i do that? ---Thanks.
Seems too simple? Add the clause
WHERE ABS(zcta) < 10000
to your query.
PG
Seems too simple? Add the clause
WHERE ABS(zcta) < 10000
to your query.
PG
that was so logical, writing 10k 🙂 --- Thanks
Hi PGSTATS, can i get hint on this-if you can please?
i have two variable in dataset named 'telno' and 'state', couple of state required zero '0' in front of 'telno' variable. if i wants to add zero '0' for couple of states only, how can i do that? 'telno' is a numeric variable...
Thanks.
case when state in ('s1','s2','s3') then '0' end || telno as telno2
telno is numeric, cannot be a || operand. Rather :
cats(case when state in ('s1','s2','s3') then '0' end, telno) as telnoChr
PG
@ DBailey- can you please write proc sql step with it - i don't know but i am not just getting it right...
Thanks
proc sql;
create table want as
select
state,
telno,
cats(case when state in ('s1','s2','s3') then '0' end, telno) as telnoChr
from
have;
quit;
Thanks you so much DBailey and PGStats. It worked...
appreciate it!
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.