Hello all, thanks for the previous replies.The following statements of trim function are from sas Help and Documentation example in sas9.4, but it gives me error any help is appreciated to remove the errors.
data afewords;
input Word1$ Word2$ ;
cards;
*some/ WHERE
*every* THING
*no* BODY
;
proc print data=afewords;run;
proc sql;
select trim(both '*' from word1) from afewords;
quit;
proc sql;
select trim(leading '*' from word1) from afewords;
quit;
proc sql;
select trim(trailing '*' from word1) from afewords;
quit;
Wrong proc! The function you are trying to use is part of proc fedql. For, example, try the following:
data afewords;
input Word1$ Word2$ ;
cards;
*some/ WHERE
*every* THING
*no* BODY
;
proc print data=afewords;
run;
proc fedsql;
select trim(both '*' from strip(word1))
from afewords
;
quit;
proc fedsql;
select trim(leading '*' from strip(word1))
from afewords
;
quit;
proc fedsql;
select trim(trailing '*' from strip(word1))
from afewords
;
quit;
Art, CEO, AnalystFinder.com
Wrong proc! The function you are trying to use is part of proc fedql. For, example, try the following:
data afewords;
input Word1$ Word2$ ;
cards;
*some/ WHERE
*every* THING
*no* BODY
;
proc print data=afewords;
run;
proc fedsql;
select trim(both '*' from strip(word1))
from afewords
;
quit;
proc fedsql;
select trim(leading '*' from strip(word1))
from afewords
;
quit;
proc fedsql;
select trim(trailing '*' from strip(word1))
from afewords
;
quit;
Art, CEO, AnalystFinder.com
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.