Here is an example of how to access the Summary Files for one table for all geographies from the ACS Summary File. The following 2005-2009 ACS 5-year Summary File example is also applicable to the current ACS Summary File.
Question: I am interested in downloading table B01001 for all published ACS geographies, how would I do this?
1)Go to the Sequence Number and Detailed Table Number Lookup File (
Chapter 2.3) to locate sequence number for table B01001. There are Excel and SAS dataset versions of the file. They are available at
www2.census.gov/acs2009_5yr/summaryfile
2)Use SF_All_Macro.sas in
http://www2.census.gov/acs2009_5yr/summaryfile/UserTools/. Run the macro:
%TableShell
(B01001);
This macro will provide metadata information on a given table, in this case B01001.
3)The following SAS dataset will be created with information about table B01001:
Table ID |
Sequence Number |
Line Number |
Start Position |
Total Cells in Table |
Total Cells in Sequence |
Table Title |
B01001 |
0013 |
|
7 |
49 CELLS |
|
SEX BY AGE |
B01001 |
0013 |
|
|
|
|
Universe: Total population |
B01001 |
0013 |
1 |
|
|
|
Total: |
B01001 |
0013 |
2 |
|
|
|
Male: |
B01001 |
0013 |
3 |
|
|
|
Under 5 years |
|
|
|
|
|
|
|
B01001 |
0013 |
47 |
|
|
|
75 to 79 years |
B01001 |
0013 |
48 |
|
|
|
80 to 84 years |
B01001 |
0013 |
49 |
|
|
|
85 years and over |
We can see that table B01001 is located in Sequence 0013; this applies to all published geographies.
4) We can read into SAS all tables in the 0013 sequence by running the SAS Example Macros:
%CallSt;
This macro will run a do loop creating State two-digit abbreviations, which will allow a simple way to read the Summary Files into SAS for all geographies. Each time a valid two digit state abbreviation is created, the macro %AllSeqs is run with the two digit state abbreviation.
The %Allseqs Macro performs the following tasks:
A.Read the geographic header file - %AnyGeo Macro.
B.There is a do loop to allow you to choose which sequences you would like to read in for example if you wanted sequence 0010 set the loop to be do x=13 %to 13; - The 0 values will be filled in.
C.Within the do loop the following macros will be executed:
a.%TablesBySeq, -- This will give information about the whole 0003 sequence, not just table B01001.
b.%ReadDataFile - This macro is called two times once for each type of estimate. This macro will generate and run SAS code for each sequence specified in the do loop in step 2 and for each geography specified in the %Callst macro.
c.Lastly, there is a merge statement that will merge together each of the three types of estimates and the geography header file by sequence number per geography.
5) You now will have all tables in the 0013 sequence read into SAS in the following dataset names, if the code is not modified, in the work directory Sf0013
.sas7bdat.