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 …
Tag: functions
Use BYTE function to create special ASCII character, e.g. plus/minus sign
data _null_;      do i=0 to 255;            x=byte(i);            put i= x=;      end;      y=rank(‘a’);      put y=;run;BYTE function results:i=65 — 90 x=…
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…
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;     …
Example 8.8: more Hosmer and Lemeshow
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…
SAS – Lowercase (lowcase) / Uppercase (upcase) / Proper Case (propcase)
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 a […]