Posts Tagged ‘ string functions ’

Example 8.20: Referencing lists of variables, part 2

January 10, 2011
By

In Example 8.19, we discussed how to refer to a group of variables with sequential names, such as varname1, varname2, varname3. This is trivial in SAS and can be done in R as we showed.It's also sometimes useful to refer to all variables which begin w...
Read more »

Tags: , , , ,
Posted in SAS | Comments Off

Example 8.19: Referencing lists of variables

January 3, 2011
By

In section 1.11.4 (p. 50), we discuss referring to lists of variables in a data set. In SAS, this can be done for variable stored in adjacent columns with the "var_x -- var_y" syntax and for variables with sequentially enumerated suffixes with the "va...
Read more »

Tags: , , , ,
Posted in SAS | Comments Off

Default value to macro variable

October 12, 2010
By

NOTE: This is a great one we picked up from our friends over at the SAS community. We have run across this literally hundreds of times while programming SAS macros. You need to have a default value for a variable and you don’t want to write another macro to set it if it doesn’t...
Read more »

Tags: , , , , , , , , , , , , , , , , ,
Posted in SAS | Comments Off

COMPRESS: SAS Function strips characters from the string

February 12, 2010
By

In SAS 9.1.3 , an extra argument (MODIFIER) is added to the SAS character string function COMPRESS and these modifiers modifies the action of the COMPRESS function; Syntax: COMPRESS(<, chars><, modifiers>) ; Following characters can ...
Read more »

Tags: , , , , , , , ,
Posted in SAS | Comments Off

SAS – Lowercase (lowcase) / Uppercase (upcase) / Proper Case (propcase)

December 30, 2009
By

We can’t stress the importance handling character case correctly. Here are the two functions you need to know and use correctly. In order to convert all characters in a sting to lowercase, use the LOWCASE function. Example: data ds_2; set ds_1; *convert it to lowercase; new_char_var=lowcase(OLD_CHAR_VAR); run; In order to convert all characters in...
Read more »

Tags: , , , , , , , , , , , , , , , , , , ,
Posted in SAS | Comments Off

Proc-x is looking for sponsors!

Dear readers, proc-x is looking for sponsors who would be willing to support the site in exchange for banner ads in the right sidebar of the site. If you are interested, please e-mail me at: [email protected]

Welcome!

SAS-X.com offers news and tutorials about the various SAS® software packages, contributed by bloggers. You are welcome to subscribe to e-mail updates, or add your SAS-blog to the site.

SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.