$UPCASEw. format

This post was kindly contributed by StudySAS Blog - go there to comment and to read the full post.


We all know the importance of UPCASE function in handling the character case strings. But do you know that a format can let you do the same as the UPCASE function (upcasing the variables).$UPCASEw. format works similar to the UPCASE Function. It also does one more thing which UPCASE function doesn’t. i.e: $UPCASEw. format let you apply length to the variable.

Remember that w specifies the width of the output field.

Example:*********************************************************;

data new;*convert it to uppercase;name=”studysas blog”; format name $upcase.;newname=put(name, $upcase32.);*Put function let you apply $upcase format;run;**********************************************;

*The length of the new variable newname will be 32.

[[ This is a content summary only. Visit my website for full links, other content, and more! ]]

This post was kindly contributed by StudySAS Blog - go there to comment and to read the full post.