SAS Comments

Two Types of Syntax

  • Type comments in between /* and */

    /* Create the HHTYPE Variable */

  • Type comments in between an asterisk and semi-colon

    *  I'll select these folks later..... if HHTYPE = "Old"  ;

    NOTE:  The forward slash asterisk commenting style can span comments made by asterisk semi-colon:

 /* I don't want to run this code ******
  *  I'll select these folks later..... if HHTYPE = "Old"  ;
       proc print data=households;
       run;
   *********************************/

   

Header Style

    /*************************************************************************
     * Program:  sys1:\computer\ohara\sasclass\demo_hh.sas
     *
     * Documents:  None
     *
     * Input Data:  "C:\sasclass\data\f6allhh.X00"
     *
     * Output Data: C:\nangrong\sasclass\data\demo_hh.01"
     *
     * Programmer:  Rick O'Hara  
     *            
     * Date:  January 20, 2001
     *
     * Description:  This program is a demo for the SAS class session
     *               titled "Miscellaneous Tips and Tricks."  The 
     * 		 demo program does several things including: 
     * 
     *		 1. Concatenates 2 types of SAS data sets.
     *		 2. Creates village-level variables.
     *               3. Runs some basic SAS procedures.
     *		 4. Explores the Output Delivery System.  
     *
     *                          
     ***************************************************************************/

 

Other Styles

    ************************************************
    *                                              *
    * Section I.  Concatenate two HH data sets.    *
    *             Check for duplicate households.  *  (note that there are no semi-colons in the text) 
    *             Keep certain "ag" variables.     *
    *             Create, rename and recode vars.  *
    *                                              *
    ************************************************;
    
    
    * 1. Concatenate NEWHHS to OLDHHS *
    ------------------------------------;

Another topic?

Wink Plone Theme by Quintagroup © 2013.

Personal tools
This is themeComment for Wink theme