# Posts Tagged ‘ functions ’

## NOTE: More on Date Increments (INTCK and INTNX)

October 29, 2012
By

It's always encouraging to get feedback about my blog articles and/or see an article spark some conversation. Last week's Date Increments (INTNX and INTCK) featured the INTNX function for incrementing (or decrementing) date, time, and datetime values b...

Tags: , ,
Posted in SAS | Comments Off

## NOTE: Writing Your Own Functions

April 25, 2011
By

Did you ever hear of PROC JLAUNCH? No, neither did I until I tried the FCmp Function Editor. And, if you didn't know, the FCmp Function Editor is an interactive tool for exploring and maintaining functions created with PROC FCMP. There are a lot of goo...

Tags: ,
Posted in SAS | Comments Off

## NOTE: The PROPCASE Function

March 28, 2011
By

Here's just a brief post about a function I just stumbled across. The PROPCASE function coverts a string to "proper case" wherein the first letter of each word is upper case and all others are lower case. Clearly this is a very useful thing for column ...

Tags: , , ,
Posted in SAS | Comments Off

## Use BYTE function to create special ASCII character, e.g. plus/minus sign

January 14, 2011
By

data _null_;&nbsp &nbsp &nbsp do i=0 to 255;&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp x=byte(i);&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp put i= x=;&nbsp &nbsp &nbsp end;&nbsp &nbsp &nbsp y=rank('a');&nbsp &nbsp &nbsp put y=;run;BYTE function results:i=65 -- 90 x=...

Tags: ,
Posted in SAS | Comments Off

## LAG function

LAG Function (SAS 9.2 Doc)*** Use a third variable to assign the value from the previous record;array one a b c d;array two e f g h;      do over one;            temp = lag(one);            if...

Tags: ,
Posted in SAS | Comments Off

## Generate random numbers

options pageno=1 nodate ls=80 ps=64;data u1(keep=x);      seed = 104;      do i = 1 to 5;            call ranuni(seed, x);            output;      end;     ...

Tags: , ,
Posted in SAS | Comments Off

## Example 8.8: more Hosmer and Lemeshow

October 5, 2010
By

This is a special R-only entry.In Example 8.7, we showed the Hosmer and Lemeshow goodness-of-fit test. Today we demonstrate more advanced computational approaches for the test.If you write a function for your own use, it hardly matters what it looks l...

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...