SASCRUNCH TRAINING
  • Home
  • SASĀ® Certification Training
    • SAS Certified Specialist Exam Training Program
    • How to Prepare For SAS Certified Specialist Base Programming Exam
  • Online Courses
    • Practical SAS Training Course for Beginners
    • Proc SQL Course
    • SAS Project Training Course
    • Logistic Regression (Credit Scoring) Modeling using SAS
  • Articles
    • Get Started >
      • 18 Free Resources to Help You Learn SAS
      • SAS Tutorial
      • How to Install SAS Studio
      • How to Learn SAS Fast
    • Data Import >
      • Importing Excel Spreadsheet
      • Importing CSV Files
      • Importing Text Files
    • SAS Functions >
      • CAT, CATT, CATS, CATX Functions
      • If-Then-Else statement
      • TRIM Function
      • STRIP Function
      • YEAR, MONTH, DAY Functions
      • Compress Function
      • Do-Loop
      • SCAN Function
      • LIKE Operator
      • INDEX Function
    • Data Manipulations >
      • The Ultimate Guide to Proc SQL
      • Proc Datasets
      • Dictionary Tables
      • Dealing with Missing Values
      • Proc Compare
      • Proc Transpose
      • RETAIN Statement
      • SAS Formats
      • SAS Arrays
    • Statistical Analysis >
      • Proc Means
      • Proc Freq
      • Proc Tabulate
    • Machine Learning >
      • Predicting Fish Species Using K-nearest Neighbor in SAS
      • Classify Product Reviews on Amazon Using Naive Bayes Model in SAS
    • Informational Interviews >
      • How to get a Clinical Trial/Research job without experience
      • Senior Recruiter at a Fortune 500 Retail Company
      • Manager, Non-profit Health Services Research
      • HR Manager
      • Quantitative Analyst
  • Services
    • The Ultimate Job Search Automation Services
    • Statistical Consulting
    • SAS Project or Assignment Help
    • Data Import Services
    • Data Manipulation and Reporting Services
  • In-class Training
    • SAS Training for Job Seekers
  • Guest Lecture
  • Sample Resume
  • About us
  • Contact Us
Improve your chance of landing a job
  • NO BS Job Tips
  • Weekly SAS Training - SAS Learning Made Easy
  • Totally Risk-Free
ENTER YOUR PRIMARY EMAIL

ACCESS TO SAS


Most of the Colleges in the US and Canada provide SAS access to the current students, alumni or visitors. Contact the Mathematics or Statistics department and see whether SAS is available to you! 

FREE RESOURCES

  • 2 Affordable ways to gain access to SAS
  • Good SAS Programming Practices
  • Submit Your Question!

BECOME A SAS PROGRAMMER


Get Free SAS Training and Learn How to Land a SAS Programmer Job

Sign up Now

Good SAS Programming Practices


Good SAS programming practices save you tons of debugging time. Below are a list of good practices that you can follow:

Picture

1. Keep a Program Header

In practice, certain SAS programs are often re-used or modified after a long period of time. When you have to dig out the program that you wrote 3 months ago from a pile of similar programs, it will be very helpful if the details of the programs are highlighted to you. The program header serves just that purpose.


Try adding the template below to your program header. One minute of work now might save you hours of time in the future! 



* Program name/path: SASCrunch.sas / C:\SAS\
* Author: SASCrunch
* Date started: 01JAN2012
* Description:   
* Datasets used:
* Revised History:
* Date:
* Author:
* Description of Change:

;

Picture

2. Use short Variable Name

Use the shortest variable name that reflects the meaning of the data.  

Example

GOOD


Data Good;
 Input Name WGT HGT;
  Datalines;
  Aaron 90 180
  Mary 48 164
  ;
Run;

BAD


Data Bad;
  Input Patients_Name Patients_Weight Patients_Height;
  Datalines;
  Aaron 90 180 90
  Mary 48 164 88
  ;
Run;


Try limiting the name to less than 7 characters. It is fast. It is less error-prone.  It will save you some good typing time! 


3. Keep a clean log window

Generating a statistical reports normally require running more than just a few programs. The more programs you have, the longer the Log Windows tend to be. To avoid spending a good 5 to 10 minutes scrolling down meaningless notices from SAS, you can search for the following 5 keywords for potential errors. 

a. Error
b. Warning
c. Uninitiated
d. Merge
e. Invalid


Keep the log window clean. Try searching for these keywords to ensure your programs are bug-free!

    Have a Question?

Submit

Like this article?


Get SASCrunch articles sent straight to your mailbox - FREE  
Sign up here  
Copyright © 2012-2019 SASCrunch.com All rights reserved.
  • Home
  • SASĀ® Certification Training
    • SAS Certified Specialist Exam Training Program
    • How to Prepare For SAS Certified Specialist Base Programming Exam
  • Online Courses
    • Practical SAS Training Course for Beginners
    • Proc SQL Course
    • SAS Project Training Course
    • Logistic Regression (Credit Scoring) Modeling using SAS
  • Articles
    • Get Started >
      • 18 Free Resources to Help You Learn SAS
      • SAS Tutorial
      • How to Install SAS Studio
      • How to Learn SAS Fast
    • Data Import >
      • Importing Excel Spreadsheet
      • Importing CSV Files
      • Importing Text Files
    • SAS Functions >
      • CAT, CATT, CATS, CATX Functions
      • If-Then-Else statement
      • TRIM Function
      • STRIP Function
      • YEAR, MONTH, DAY Functions
      • Compress Function
      • Do-Loop
      • SCAN Function
      • LIKE Operator
      • INDEX Function
    • Data Manipulations >
      • The Ultimate Guide to Proc SQL
      • Proc Datasets
      • Dictionary Tables
      • Dealing with Missing Values
      • Proc Compare
      • Proc Transpose
      • RETAIN Statement
      • SAS Formats
      • SAS Arrays
    • Statistical Analysis >
      • Proc Means
      • Proc Freq
      • Proc Tabulate
    • Machine Learning >
      • Predicting Fish Species Using K-nearest Neighbor in SAS
      • Classify Product Reviews on Amazon Using Naive Bayes Model in SAS
    • Informational Interviews >
      • How to get a Clinical Trial/Research job without experience
      • Senior Recruiter at a Fortune 500 Retail Company
      • Manager, Non-profit Health Services Research
      • HR Manager
      • Quantitative Analyst
  • Services
    • The Ultimate Job Search Automation Services
    • Statistical Consulting
    • SAS Project or Assignment Help
    • Data Import Services
    • Data Manipulation and Reporting Services
  • In-class Training
    • SAS Training for Job Seekers
  • Guest Lecture
  • Sample Resume
  • About us
  • Contact Us