Monatsarchiv für November 2011

 
 

Vim as A SAS IDE

Few configurations (just copy this sas.vim file to C:Program Filesvimvim73syntax if you also use gVIM 7.3 at Windows) to make Vim as a simple SAS IDE where

F3: run SAS codes (in batch mode)
F4: close other two windows (the current active window is Log window after F3 running; F4 jump to SAS file with full window)

F5: jump to SAS file
F6: jump to Log file
F7: jump to lst file (list output)
F8: keep only the current window (full window)

****************

Details and Credits

1. The first post on Vim and SAS I read is by Xiaowei Wang in Chinese.

The original SAS syntax file took from Zhenhuan Hu.

Kent Nassen also maintains some Vim functions to run SAS codes and check log.

2. To run SAS codes using F3:

map <F3> :w<CR>:!SAS % -CONFIG “C:Program FilesSASSASFoundation9.2nlsenSASV9.CFG“<CR>:sp  %<.lst<CR>:sp  %<.log<CR>

3. Close other windows using F4:

map <F4> :close<CR>:close<CR>

4. Keep only current window using F8:

map <F8> : only<CR>

5. Jump to SAS file using F5:

map <F5> :e %<.sas<CR>

6. Jump to Log file using F6:

map <F6> :e %<.log<CR>

7. Jump to Lst file using F7:

map <F7> :e %<.lst<CR>

My Collection of SAS Macro Repositories

Then I just find that the most effective and safest way to synchronize bookmarks across machines is making them Google searchable, i.e, putting them online.

Followings are my personal collections of SAS macro Repositories (I will keep it update according to new sites reached and your inputs). Most of them are rich, well documented and friendly for navigation and review:

/***General***/

1. SAS Macros by Richard DeVenezia

http://www.devenezia.com/downloads/sas/macros/index.php

Richard is a very active contributor in SAS-L. He also plays with Java, Perl, PHP and JavaScript and you can find all these codes in his homepage. Besides the well organized macros, there are some interesting utilities:

http://www.devenezia.com/downloads/sas/samples/

2. Roland‘s SAS Macros

http://www.datasavantconsulting.com/roland/Spectre/maclist2.html

Roland, a proficient SAS programmer from Europe, also supply two SAS applications:

Spectre – a Practical and Educational Clinical Trials Reporting Engine
http://www.datasavantconsulting.com/roland/Spectre/index.html

RGPP -Graphical Patient Profiler
http://www.datasavantconsulting.com/roland/RGPP/rgpp.html

And some tips:
http://www.datasavantconsulting.com/roland/sastips.html

3. Chris‘s SAS Macros

http://sas.cswenson.com/downloads/macros

I just found Chris’ site weeks before and Chris is a pretty cool programmer: in one of his fun macros, an error message will be such kind of form:

ERROR: MWA HA HA! You fool! You are cursed with leprosy!

4. sconsig SAS Coding Tips and Techniques 

http://www.sconsig.com/sastip.htm

rich while badly for navigating and review

5. Arnold Schick’s macros

http://schick.tripod.com/macros.html

also some macros collected from SAS-L :

http://schick.tripod.com/p-index.html

6. Rodney A. Sparapani ‘s Macro

http://www.mcw.edu/PCOR/Education/SASMacros.htm

Rodney is best known for his contribution to SAS support in ESS (Emacs Speaks Statistics) as a cool programmer and WinBugs and Bayesian then he works as a statistician.

Rodney’s site also contains lots of statistical stuff.

/***Statistics***/

1. Mayo Clinic Locally Written SAS Macros
http://cancercenter.mayo.edu/mayo/research/biostat/sasmacros.cfm

or in

http://mayoresearch.mayo.edu/biostat/sasmacros.cfm

2. Paul D. Allison
http://www.ssc.upenn.edu/~allison/#Macros
new site: http://www.pauldallison.com/Download3.html

Paul is a prolific writer with books on SAS and statistics.

3. MCHP SAS Macros

http://mchp-appserv.cpe.umanitoba.ca/viewConcept.php?conceptID=1048

4. Ralph O’Brien ,UnifyPow: A SAS Module for Sample-Size Analysis
http://www.bio.ri.ccf.org/Power/

5. Usual Dietary Intakes: SAS Macros for the NCI Method
http://riskfactor.cancer.gov/diet/usualintakes/macros.html

6. Clinician’s corner: SAS macros
http://www.medicine.mcgill.ca/epidemiology/Joseph/PBelisle/sas-macros.html

/***Graph***/

1. Robert Allison’s SAS/Graph Examples!
http://robslink.com/SAS/Home.htm

My first stop for SAS graphics.

2. SAS Graphic Programs and Macros by Michael Friendly
http://www.datavis.ca/sasmac/

more popular in academia.

Get Start with WPS, and Call for an Elegant SAS IDE!

I got a trial version of WPS (the latest version 2.5.2.0 at Windows), which engine can interpret “some of the language of SAS”. I took piece of codes for testing and some passed while some popped up with errors (so currently it is only a limited version of SAS). I don’t drive into the deep part yet of what WPS can do and can’t do, but I do love the WPS way to organize projects, folders and files (including souse files):

WPS_SAS

WPS uses a lite version of Eclipse as GUI(WPS Workbench; the “lite” means WPS Workbench can’t be extensible as the original Eclipse but really with shorter response time). Besides its Project Explore for folders and files management(left panel), I also love its Outline in right panel to show the SAS programming elements and errors information in log window:

WPS_LOG

Then I’d like to switch to SAS itself. Frankly speaking, at least in IDE part, WPS looks pretty better than the current corresponding SAS:

SAS_GUI

Of course I hold the principle of “substance over form”, but if available, the form itself also make people comfortable and enjoyable (for example, the Apple products…). As far as I know, the new version of SAS DI Studio and Enterprise Miner both have pretty much improvement in GUI from ergonomic point of view. Even for code editor, Enterprise Guide Editor  is now more superior than so called SAS Enhanced Editor. But as a SAS programmer (not only the SAS user), I may spend all my day in the Base SAS window!

I also spent some time to configure VIM as a relative simple SAS IDE as a temporally replacement (F3 to run, F5 to jump to program window, F6 to log window, F7 to output window just as the same as in SAS IDE):

VIM_SAS It’s simple but always can do the job as SAS itself while looks really cool to comfort myself as a programmer. So, what’s going on in the next release? Still wait.