Suggested Directory Structure for a Marketing Department: /Product/Campaign/Datatype/Campaign_RawTable.Datatype For a 'Fab' Campaign for Popcorn poppers: Consider /Pop/Fab/Sd1/Fab_Dem.sd1 /* Demographics of Target Population */ /Fab_Zip.sd1 /* Zipcode Characteristics of Target Pop */ /Sas/Fab_Dem.sas /* Programs Log and Lst */ /Rtf/Fab_Dem.rtf /* rtf output */ /Cgm/Fab_Zip.cgm Note file Fab_Dem.rtf ==> /Pop/Fab/Rtf ( but Fab must be unique tp Pop - Fab can have only one Father (Pop) ) If I email Fab_RawDem.rtf to a user ouside my department, the user could call me back weeks later and I would know exactly where Fab_RawDem.rtf came from. Note 'Fab' should be a globally unique and only associated with a specific Popcorn popper campaign. 'Fab' cannot be reused and should be registered. There are analogs to this structure in Finance and pharmaceuticals. Consider the SAS Tables Fab_Dem /* users can add anthing after Dem, however I suggest TLAs */ Suggested Variable Names for table Fab_Dem Fab_DemSsn - Primary Key Social Security Number Fab_DemSex - Gender of Ssn Fab_DemAge - Age of Ssn holder Fab_DemPay - Income Fab_DemPet - Ssn have a Pet Y/N Fab_DemZip etc Develop your own TLAs and stick to them. Your programs will become more readable and consistent from one project to another. Fab_Zip Fab_ZipZip - Zipcode and Primary Key Fab_ZipPay - Average Income in Zip Fab_ZipAge - Ave Age of Head of Household For a more advanced discussion of a naming convention in a relational setting see soap001,2 and 7 at members.aol.com/xlr82sas/utl.html. I show an example of a naming convention for a transper table, and with longer format names the foreign keys in a transfer table can be set up as a format. Why this structure: 1. Clean SQL and Datastep Code - do not have to worry about name colisions. ( although you may need to rename key variable before a merge) 2. When transposed the Names contain useful data, which can be parsed and has the potential to be powerful tokens. Very hady when using metadata sashelp.vcolumn. 3. Self documenting code with improved debugging capabilities. 4. Ability to trace the variables and tables through a complex multistep analysis 5. Almost mandatory for full outer joins. Just consider a full join on four tables with many common variable names. 6. Provides a structure for data normalization. 7. Facilitates the implementation of relational transfer tables, these tables help resolve many to many joins. /*--------------------------*\ | Analysis Datasets | \*--------------------------*/ Analysis and composite Table Names and Table column names. Suppose we want to Summarize Fab_Dem at the Zip level. Possible new analysis table name: Fab_DemSum or Fab_DemZipSum Column Names Fab_DemZip Fab_DemAgeAvg /* Average Age */ Fab_DemPayAvg Fab_DemPayMin Fab_DemPayMax Fab_DemPayStd Fab_DemFemCnt /* Count of Fenmales */ Fab_DemMalCnt /* Count of Males */ If you transpose this data and can easily select out the Pay statistics using Substr(name,8,3)='Pay'. Note, if you stick with TLAs, you will tend to be more consistent with all your programs, for instance always use Min - for minimum valyes Max for Maximums Ave for Average Values Also consider putting the statistic TLAs last(Ave, Max, Min, 1st, 2nd etc ). ie Fab_DemPayMax not Fab_DemMaxPay, Max is a property of Dem not Max. etc. Other tips on Variable Names, Campaign names etc Suppose you already have a campaign number 2389 and you need a TLA for this campaign. 4011 is 'FAB' in hex so you can use Fab as a TLA for that campaign. You can even get 4011 back using sas informats. Other SAS Variable names Suppose Fab_DemSsn is character '123456789' and you want to create numeric equivalent. Prefix the variable with a lower case n. (c for character ) nFab_DemSsn = Input(Fab_DemSsn,10.); or Fab_DemSsnN tFab_DemSav ==> temporary variable or Fab_DemSavT lFab_DemSav ==> Local Macro Variable or Fab_DemSavL gFab_DemSav ==> Global Macro Variable or Fab_DemSavG Other Prefix and Suffix possibilities: Foreign Key Variables in Dem Table Dem_Zip_ZipCde ==> Column in the Dem table that is a foreign key to Zip Useful Deviations Fab_FunWthSasForAllPeoPle If you cannot come up with a TLA, then string to TLAs together. ie PeoPle. This helps when parsing out for meta data. Use PeoPle everwhere. A key to some good TLAs is two consonants with a vowel in the middle ie Consonant ( a e i o u y ) Consonant Consider DayTym instead of DayTime NytTym instead of night time Fyl instead of File Byt instead of Byte Big, Max Ltl, Min Certain consonants sound like vowels B - E T - E C - E D - E L - A P - E V - E Z - E Zro -- you do not need a 'e' next to the Z NonZro GteZro - Greater than or equal to zero Txt - Text Btr - Better ( do not need the e's ) Lbl - Label Lte - Late Lst - Last Lbr - Labor --------------------------------------------------------------------------------- Slo - Slow Flo - Flow Gro - Grow --------------------------------------------------------------------------------- Some numbers can help Ssn1st - first SSN Ssn2nd - Second SSN etc If you are stll using 8.2 the number 2 can be used for formats Ssn2Sex - SSN number to Sex Ssn2Wgt Ssn2Age Sex2Txt ( 1- Female 2-Male ) ----------------------------------------------------------------------------------- SAS Labels for variable names and SAS table names Proc Sql; Create Table Fab.Fab_DemSum (Label="Created by Fab_DemSum 1280 Rows 17 Columns Fab_Dem Summarized to Zip Level") as Select Fab_DemZip, Mean(Fab_DemAge) as Fab_DemAgeAve Label="Mean Age at Zipcode Level", .....