2014年1月13日星期一

Some Good Code Habits in SAS Language Programming

Over a period of ten years, I have seen much good code, much more bad code, and lots more of mediocre and lazy coding habits. From my experience here are some ten tips to improve your SAS coding experience.

1 ) Use options compress=yes; to save space. This saves space by a factor of 50%. I have often been bemused by the number of times I have been approached for more data storage by analytics practitioners and their wonderful exclamations of surprise on hearing about this option.

2 ) Do not rely on the SAS Macro language excessively. Code should be easy to read and modify. Use options macrogen symbolgen; to make Macro code in logs more readable. Using the SAS Macro language excessively is a traditional swagger fail in power and advanced users.

3 ) Preferably copy and paste small parts of log in the script code itself , if you are not in the habit of saving logs. Comment out the logs/output. This is needed especially for version control of datasets, variable creation, file sizes. While copying and pasting logs and output to script/editor window can sometimes be problematic , it helps make code more understandable and much more efficient to project managers and transition managers. Version control in dataset names is critical to make the projects more streamlined.

4 ) Please comment on code. Not every human being can read SAS code like a computer. Use Ctrl + / to comment and Ctrl + Shift + / to uncomment code. Comments are statments and code between /* and * and they are ignored upon program execution.

5 ) Use Keyboard Macros to cut down on repeated code steps like various procs.

6 ) Utilize Cross Tabs-
Use -
proc freq data=dataset ;
tables varnames*varnames2 /list nomissing ;
run ;
as a powerful way to understand cross tab as an analytical technique. It beats many other more complicated ways to look at the data.

7 ) It is best to optimize and balance Proc sql and Data step for data manipulation. While Proc SQL is quite good for existing learners of SQL and for merging datasets if they are indexed, the Data Step is a powerful way to manipulate data. Avoid using either of them exclusively to the detriment of the other.

8 ) Read updates to support.sas.com or participate on sascommunity.org as many new features are often buried deep within these websites. New methods like hash method are quite powerful.

9 ) Learn cross platform techniques like using R from within SAS, or connecting to Oracle Databases from SAS, or using SAS and JMP together. Preferably get certified in at least one analytics certificate.

10 ) Learn how to use sub queries within proc sql efficiently including using aggregated functions within proc sql. The case expression method is a powerful and much underutilized method within proc sql.

Hope this helps your SAS coding. Do share your top practices.
Links:
If you have corrupted your memory card, it is highly recommended to stop further operations on the memory card. Then try to use data recovery tool to save the data. recovery sd card can retrive the data in most cases. It is the best way to undelete deleted photos on a Canon digital camera which is lost due to delete, format by accident, file system change to RAW or unplug the camera without disconnect it first etc. sd card recovery free can help you solve these troubles. And the most cost-effective way is to use this software.

SD Memory Card Recovery is your ideal tool to Repair SD Card.

At present, How to recover photos from sd card is a normal topic on some photography forums. Some photographers took pictures and then deleted accidentally. These lost pictures are so important for them, so they have to discover an efficient way to recover the lost digital pictures. But how to retrieve these pictures is a great task for card users. Digital Pictures Recovery Pro can recover missing, deleted or corrupted digital pictures from your SD card or hard disk. With the scanning of selected storage device, it provides the list of all the photos and other multimedia files. Digital Pictures Recovery Pro v2.6 will display an easy way for you to recover the lots photos. SD card photo recovery process will help you get the missing pictures as soon as possible. All in all, Pictures Recovery will help you recover lost photos with ease.

After Market Software Development - Potential Residual Income
The Features Of Mobile Cameras
Mobile Websites Help You Increasing Your Business Revenue
Conferences software how to run a successful video conference
Scan Windows Registry - How To Do It And How To Deal With The Risk

没有评论:

发表评论