Variable and Table naming conventions for SAS V7 Soap0001 continued Ramblings on naming conventions You should read SOAP0001 before reading this: Recall the three tables Some facts All tables have a unique TLA ( triple letter acronym ) This naming convention applies more to 'source/external' data and not derived data(datastores). Their is only one 'zip' table ( zip_taxmaster ). If another zip table is included in the database call it zyp_salesmaster. Tables ------ ssn_ssnmstr - us social security master zip_taxmaster - tax payments by zipcode ssz_zipassign - transfer table ssn to zip ---fact table-- --fact table--- ssn_ssnmaster zip_taxmaster ============= ================ ssn_key -------> primary key zip_key -------> primary key ssn_issuedate ssn_issueoffice zip_statetax .. zip_localtax .. zip_federaltax .. .. ssn_timestamp zip_timestamp ssz_zipassign ============= ssz_ssn_key primary key ssn table foreign key ssz table ssz_zip_key primary key zip table foreign key ssz table ssz_curentdata ssz_timestamp /*-------------------------------------*\ | Macro naming conventions | \*-------------------------------------*/ Suppose we have a macro which creates table zip_taxmaster. Consider naming such a macro utlaea_zipcreate. utl - distiguish your set of macros from user macros or system macros. aea - hierarchy When you build a system you never see the entire sequence and hierarchy of jobs. if you start with utlaea you can later add predecessors utlabe, utlabh, utladr etc. With a little care you can develop macro drivers utlae -- driver that calls utlaeb utlaeg utlaek etc zipcreate - descriptive name local macro variables created in utlaea l_utlaea_counter1 l_utlaea_counter2 global macro variables created in utlaea g_utlaea_maxcounter g_utlaea_mincounter meta macro variables All meta macro variable names should be registered for standard interface conventions and automatic docimentation m_utl_title m_utl_obj %macro utlaea_zipcreate ( /* special registered metatdata names common to all macros */ m_utl_title=Create table zip_taxmaster, m_utl_obj=utl, m_utl_inlib1=c:\obj, m_utl_inmem11=p_utlabe_ziporiginal, /* permanent analysis dataset created by macro utlabe */ m_utl_inmem12=testdata2, m_utl_options=%str(obs=100 ls-133 ps=61), m_utl_outlib1=d:\obj, m_utl_outmem11=t_utlaea_zipcopy, m_utl_flowpoint=010100101 ) / des ="Create table zip_taxmaster"; /* convention for local macro variables */ %local l_utlaea_counter1 l_utlaea_total1 ; /* convention for global macro variables */ %global g_utlaea_maxcount g_utlaea_maxcount ; /*-------------------------------------*\ | Table naming conventions | \*-------------------------------------*/ Externals or Source ssn_ssnmstr - us social security master zip_taxmaster - tax payments by zipcode ssz_zipassign - transfer table ssn to zip Temporary Tables t_utlaea_zipcopy Permanent derived tables p_utlaea_zipmaster Some other thoughts s_utlaea_zipmaster - synchonizable table r_utlaea_addressmaster - read only table /*-------------------------------------*\ | Non macro variable names | | No prefix for saved names | \*-------------------------------------*/ t_tempcounter1 - temporary variable a_monthday(12,31) - array names monthday1 -- monthday366 I will add to this periodically