SAS Enterprise Miner (EM) is indeed a fancy tool for a SAS programmer who wants to switch to the field of data mining. It is like the point-and-click camera: you drag several nodes onto the diagram, run it and everything is settled. And I was quite i…
Tag: macro
Proc Fcmp(2): a subroutine for Binomial-CRR model
Problems: Quote for six-month American style euro currency options on plain vanilla, Max[S-K,0]and 〖Max[S-K,0]〗^0.5. Exchange rate S_0=$1.3721 /euroSix-month continuously compounded inter-bank rates: r=0.4472%,r_f=1.2840%.Assumptions:The exchange r…
Use DO WHILE to read in every word in a string
%local cnt tword ntot1;%let cnt=1;%let tword=%qscan(&tstring,&cnt,%str( ));%* let ntot1=%qscan(&tcount,&cnt,%str( ));%do %while(&tword ne);      data _null_;            set &dir..&dsn;          &n…
Rename all vars in a dataset using SASHELP
*Create a temporary dataset… DSN;data dsn;a=1;b=2;c=3;d=4;e=5;f=6;run;%macro test(lib,dsn);*/1)*/ data _null_;      set sashelp.vtable(where=(libname=”&LIB” and memname=”&DSN”));      call symput(‘nvars’,nvar);run;*/2)*/ data …
!= does not == ne
In general, the more programming languages you work with, the better you are going to become as a programmer. I try to work with a new language about every year, so I can stretch my little brain in lots of different directions.However, the downside is…
Dump wide table to HTML report (SAS)
This SAS macro dumps a data set with many variables to an HTML report in a single line of SAS code. It’s useful on wide data sets (or in database speak, a wide table with many columns), with long character values, or where the customer needs to f…
Macros for Standard Date/Time Processing
SAS Macro to process date/time
Handling leading, trailing blanks in macro variable
If a macro variable contains leading or trailing blanks, they can be easily removed without the use of %LEFT or %TRIM. Simply:%let macvar = &macvar;