*----This is the datasets_attribs module. It consists of the SAS Atrib statements for creating the structure of a Datasets meta-dataset. It gets included by the doset macro as part of the Data step that generates these metadata observations/datasets. JGB, December 30, 2002 Update history: 01-23-03: Replacing pgmr with contactEmail and contactName 1/27/2003 4:07PM: Making SubType and SetGroup longer ($24). 1/28/2003 11:18AM Changing all vars with length $1000 to $2000. (Later changed means & mweights back to 1000). 1/29/2003 10:33AM Adding format codes to long strings so we can fsbrowse and not require 6 screens. 2/4/2003 11:25AM Making Units 64 chars instead of 32. 1/26/2004 12:59PM Shortening some format specs so these obs. will display in fsbrowse on fewer screens. Deleting reference to URLxtract variable. 1/26/2006 8:59AM Changing length of memlabel from 64 to 96. 3/31/2015 Numerous changes, mostly to shorten char vars and to drop some that have never been used (means, mweights, filters). Sortprio length now $2. Added LatestYear. ----*; Attrib libname length=$8 label='Library name'; /* libname is a permanently assigned libref value that is/was used to create the dataset. It is also the name by which it will be referenced in all automated applications. It can be important when using views to know what name was used to create the original set. Per SAS syntax rules, it can be no longer than 8 characters. */ Attrib memname length=$32 label='Member name'; /* The SAS dataset or view name. Note that libname and memname together form the unique key to the Datasets dataset */ Attrib memtype length=$8 label='Member type'; /* Valid values are data, sasview and sqlview (for now) */ Attrib engine length=$8; /* SAS engine name. From Proc Contents (usually V9) */ Attrib memlabel length=$96 label='SAS member label'; /* This is the label stored with the data member. Changed value from 64 to 96 Jan 06. We keep it shorter than the allowed 255 because we have a separate description variable for when we want to specify more detail. */ Attrib Nobs length=4 ; /* # of observations in the dataset. Will be missing for views. */ Attrib NIdx length=3 label='# of indices defined'; /* Good check to see if it meshes with manually coded indexedby parm */ Attrib Nvars length=4 label='Total # variables'; /* # of variables in the dataset observations. */ Attrib Nlabels length=4 label='# of variables with labels defined'; /* # of variables with labels */ Attrib ObsLen length=4 label='Length of observations (rows) in bytes'; /* appx length of observations obtained by summing lengths of all variables */ Attrib Kbytes length=4 label='Appx size in Kbytes' format=comma9.; /* derived as round((obslen*nobs)/1000). Ignores effect of compression. */ Attrib Compressed length=$1 label='Compressed? (y/n)'; /* do not keep type of compression just yes or no flag, lowercase letter */ Attrib Created length=8 label='When created' format=datetime7. informat=datetime13.; /* The date (and time) dataset was first created. The default format prints just the data portion in ddMMMyy format. Use datetime13 or datetime13 to see time as well.*/ Attrib Modified length=8 label='When last modified' format=datetime7. informat=datetime13.; /* The date (and time) dataset was last modified. The default format prints just the data portion in ddMMMyy format. Used datetime13 or datetime16 to see time as well.*/ Attrib LibPath length=$96 label='Fully Qualified Path for libname'; /* For the mcdc/oseda conventions this will be broken down into the following DataDir, filetype and SubDir components. */ Attrib DataDir length=$12 label='High level data directory'; /* The first two levels of the path associated with libname. It will be (for now) one of two values: /pub/data (for sets on the mcdc.missouri.edu AIX box), or /mscdc/data (for sets on the oseda.missouri.edu AIX box.) */ Attrib FileType length=$8 label='File Type: Subdirectory of DataDir indicating major data category'; /* In the MCDC / OSEDA data archive this is a specific designation corresponding to a subdirectory of the master data directory (/mscdc/data on the oseda box, /pub/data on the mcdc box. It normally has the same value as libname. */ Attrib SubDir length=$24 label='Subdirectory of filetype'; /* We expect to find the dataset in the directory formed by: &datadir/&filetype/&subdir . SubDir is usually blank because we usually store the datasets for a filetype directly in the filetype directory. But sometimes we have a subcollection and that is where this parm is needed. E.g. SubDir=TractsByState . Note that all these path parms are CASE SENSITIVE. */ Attrib Filename length=$40 label='Name of system file corr to SAS dataset'; /* includes the SAS member name and then the platform/engine specific extension */ /* IMPORTANT: Variables above are derived from a proc contents report, except for libname. The remaining variables generally require some human input. They are specified via parms to the doset macro or some other means. Most of the variables below this point can be assigned defaults by looking them up in the &refset dataset (assumed to be in the &libname data library). */ Attrib Description length=$512 label='Detailed Description' ; /* For when you really want to describe the dataset in detail. */ Attrib RefSet length=$32 label='Reference dataset with similar characteristics.'; /* The reference dataset has to be in the same directory. The dataset will "inherit" attributes from this dataset as defaults when those attributes are not specified within the doset macro. Inherited characteristics include GeoUniv Units Years KeyVars thru KeyIdvars DataSource Years SortedBy IndexedBy CreateLib Filetype contactEmail contactName SetGroup UsageNotes and URL_meta. The refset creates a kind of equivalency class that includes the reference dataset and all sets that have it as the refset.*/ Attrib GeoUniv length=$32 label='Geographic Universe'; /* Values can be state names, 'United States', or name of other geographic areas. */ Attrib Units length=$64 label='Observation Units'; /* What each observation in the dataset represents -- such as states, counties, persons, households, banks, bank branches, school districts, etc. It can be a list separated by commas. Smallest unit is last one. */ Attrib SortPrio length=$2 label='Sort priority'; /* Certain data access applications will sort datasets by this field within libname. Can be used, for example, to have Missouri (universe) files display first, followed by US files, then by other specified states, etc. See code in doset macro that assigns default values based on GeoUniv. */ Attrib Years length=$32 label='Data Years'; /* The information within the observations is for this year or years. If the dataset has data for multiple years they should be listed in descending order separted by commas, e.g. "2000, 1990". It can also be an interval such as "1969-2000" */ Attrib LatestYear length=$4 label='Latest Year'; /* When Years is an interval or contains multiple value it is good to have the latest value. */ Attrib SubType length=$24; /* A sub-type is designated when there are multiple kinds of datasets within a directory in terms of what variables they contain. For example within the sf32000 filetype we have subtype values geos, ph, phct, phctr and combined. All filetypes can have a meta subtype to indicate metadata (such as the Datasets and Variables datasets). */ Attrib SetGroup length=$24 label='Group to which this set belongs'; /* Sometimes we have a group of related datasets that form a logical whole. For example on sf32000 we might have mogeos, moph, mophct and mophctr all containing data pertaining to the same geographic entities. So we could create the "mo" group and specify that these sets all "go together". For the sake of organizing things in reports and other applications. Sets within a SetGroup are likely to be merged. They often share Universe and Units values. */ Attrib VarSet length=$32 label='SAS dataset with var level metadata'; /* If its a 1-level name then &libname is assumed to be first level. Typical value would be "Variables". Frequently blank, indicating no such set. */ Attrib KeyVars length=$128 label='Key Variables used to ID rows (observations)'; /* A list of variables that are designated as "keys" that are commonly used to access or filter the set. This variable and the 3 that follow are all designed to contain values that will be passed as parms to the genkeys macro. (In fact, we may modify that macro to have it obtain these values direct from the metadata dataset.) */ Attrib KeyQuals length=$64 label='Key Variable Qualifiers'; /* See the genkeys.sas module in /pub/sasmacro for a description. It is a list that parallels KeyVars */ Attrib KeyFmats length=$128 label='Key Variable format codes'; /* See the genkeys.sas module in /pub/sasmacro for a description. It is a list that parallels KeyVars and specified custom format codes that provide labels for the key variables. */ Attrib KeyIdvars length=$64 label='Key Variable id variables'; /* See the genkeys.sas module in /pub/sasmacro for a description. It is a list that parallels KeyVars and names variables that contain the actual names associated with those variables. Normally not used much. */ ***Attrib Means length=$1000 label='Means, Percentages, etc.' format=$40.; /* A list of variables that have to be treated specially when aggregating. The value of means and mweights are intended as values that can be passed to the agg macro */ ***Attrib Mweights length=$1000 label='Mean weight variables' format=$40.; /* See above (Means). */ Attrib UsageNotes length=$2000 label='Usage Notes re using this dataset' format=$512. ; /* This would be a good place to put things like known problems with the data, or missing values/observations or things like be sure to filter on the chariter var. */ Attrib DataSource length=$96 label='Source of the data'; /* Specify the provided and the product. E.g. U.S. Bureau of the Census: SF3, 2000 Census */ Attrib SortedBy length=$40 label='Sorted by Variables'; /* List of variables that serves as the sortedby option for the dataset. Its a list of 1 or more variables with option desceding keywords. */ Attrib IndexedBy length=$40 label='Indices Defined'; /* List of simple or complex indices, separated by vertical bars. E.g. Logrecno | slgeo=(SumLev Geocode) this would indicate a simple index on logrecno and a compound index called slgeo based on combination of SumLev and Geocode variables. */ Attrib CreatePgm length=$32 label='Program that created the dataset'; /* This is the value of the &pgm parm using the jgb naming conventions. It is the name of the current program, sans path and .sas suffix. */ Attrib CreateLib length=$32 label='Path for CreatePgm'; /* If value is just "Tools" then it is assumed to be in the Tools subdirectory of &path */ Attrib contactEmail length=$64 label='E-mail address of person who supports dataset'; Attrib contactName length=$24 label='Name of person who supports dataset'; /* This should be the person who ran the conversion and created the meta obs for the dataset. Or, the person responsible for supporting the set after the orginal person leaves. */ /* The next two URLs can be derived and will not have to be entered */ Attrib URLdirect length=$128 label='URL to access the dataset directly'; /* Datasets on the oseda machine will have a blank value for this variable because they cannot be accessed directly. But on mcdc they can. This URL would take you directly to the set so your browser would have to be configured to do something with it (like have sasview ready to take over.) */ ***Attrib URLxtract length=$128 label='URL to access dataset via uexplore/xtract app'; /* This URL would take you to the xtract application with the dataset selected. From there you could filter and specify the variables you want. */ Attrib URLmeta length=$128 label='URL to relevant metadata'; /* In case there is additional metadata on a web page this URL will direct you there. Frequently blank. */ ***Attrib filters length=$256 label='Standard filters for creating subsets' format=$40. ; /* We need to refine this idea but we want to have some way of representing one or more predefined "standard" ways to subset the data. Such as common filters based on a SumLev or other "obs type" variable, or a filter based on a state code. */ Attrib KeyWords length=$256 format=$64. ; /* Use this item to create subject-matter keys. E.g. age, race, income, occupation,...*/