Skip Navigation

UNC Carolina Population Center

 

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: /sasclass/data/f6allhh.X00
    *
    * Output Data: /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?
Questions or comments?  If you are affiliated with the Carolina Population Center, send them to Phil Bardsley.