Archiver Help

The SDA Archiver procedure facilitates the installation of SDA datasets and codebooks in an SDA data archive.

There are seven steps to the process:

  1. Set the Study ID
  2. Upload the Data File
  3. Upload the Metadata File
  4. Create the SDA Dataset
  5. Upload the Variable List
  6. Create the Codebook(s)
  7. Set Up the Study in the SDA Archive

Set the Study ID

The ID for the study provides a way to identify and to locate a particular dataset. In the SDA data archive the ID is used as the name of a directory for the study.

The ID for the study must be one word containing only letters and numbers (with no spaces or special characters like punctuation marks).

When you enter a study ID, the system will check to see if that ID has already been used.

Upload the Data File

The data file must be a plain text file (an ASCII file) with each variable in a fixed set of columns.

Specify the data file's location on your local machine by using the "Browse" button. When the data file has been located, click the "Upload File" button.

The data file can be named anything on your own computer and can be located anywhere on your disks. On the server computer, however, it will be stored in the /DATA subdirectory of the study and will be given the name 'data.txt'.

Upload the Metadata File

The metadata file must be an SDA DDL file. This DDL file describes the content and layout of the data file you have already uploaded. For information on the syntax and content of a DDL file, see the DDL document in the online SDA manual.

If you have a metadata file in a different format, there are some tools to help you convert that metadata file into a DDL file:

Once you have generated a DDL file that matches the data file, you need to upload it to the server. Specify the DDL file's location on your local machine by using the "Browse" button. When the DDL file has been located, click the "Upload File" button.

The DDL file on your local computer can be named anything. But note that it will be stored on the server in the  /METADATA/DDL subdirectory of the study and will be given the name 'ddl.txt'.

After the DDL file has been uploaded to the server, it will be checked for syntax errors. If errors are detected, fix your DDL file and then upload it again.

After the DDL file has been checked for syntax errors, the SDA DDLTOX program is automatically executed to produce metadata files in other formats: SPSS, SAS, Stata, and XML (DDI-version 2). These other metadata formats will then be available for download (unless this option is turned off when finalizing the archive).

Create the SDA Dataset

Once you have uploaded a data file and a matching DDL (metadata) file, you are ready to create the SDA dataset for this study.

Click the button on this screen, to run the SDA MAKESDA program. The SDA dataset is then stored in the archive directory that has the name of your study ID.

Upload the Variable List

Important Functions of the Variable List

Although not strictly required, providing a variable list with headings is really a practical necessity when archiving datasets with a significant number of variables. The headings in the variable list organize both the tree menu's and codebook's listings of variables -- which greatly improves the user experience. The variable list can also be used to customize the description of variables in the codebook. All of these functions are described below:

(If you only have a few variables in your dataset and do not need headings or other options, check the box next to "Use the basic variable list without headings" and go on to the next step to create the codebook.)


Syntax of a Variable List

(See examples below)


Three examples of variable lists are given, followed by an example of a tree menu of variables that uses those headings.

1. Variable list with NO headings -- (the starting point)

CASEID
spend
spend2
spend3
spend4
ideo
party
age
educ
gender
race
marital
casewt

2. Variable list with TWO LEVELS OF HEADINGS

# (Primary headings start with   **   and secondary headings start with 2**  )

** CASE IDENTIFICATION
CASEID

** SURVEY VARIABLES
2** Government Spending
spend
spend2
spend3
spend4

2** Political Ideology and Party
ideo
party

2** Background Variables
age
educ
gender
race
marital

** WEIGHT VARIABLE
casewt

3. Variable list with HEADINGS, TEMPLATES AND RECODES

# (Template references start with   @  )
# (Recode commands are appended to the variable names.)

** CASE IDENTIFICATION
CASEID

** SURVEY VARIABLES
2** Government Spending
spend
spend2
spend3
spend4
2** Political Ideology and Party
ideo
party
2** Background Variables

# Get category frequencies plus summary statistics
#   for the following variables
@cstats

# Collapse 'age' into 10-year categories, starting with 1
age(c:10,1)

# Return to category frequencies without statistics
#  (which is also the default template)
@categ


# Show both the original version of "education"
#   and a recoded version of the variable
educ
educ(r:0-8 "Elementary" ; 9-12 "HS" ; 13-* "College")

gender
race
marital

** WEIGHT VARIABLE

# Get summary statistics alone, without category frequencies 
@stats
casewt


Tree Menu of Variables (using the Headings Provided in the Variable List)

(If you don't use any headings, you will just get one long list of variable names.)


Create the Codebook

Once you have created an SDA dataset and have uploaded a variable list with headings (and possibly with other specifications such as recodes, collapses, and templates), you can create a codebook to document the dataset.

Clicking on the "Create Codebook" button will automatically create both an HTML codebook and a "tagged" format codebook. The "tagged" format codebook can be used to create a Microsoft Word codebook, as explained below. (Click on the 'Show/Hide Other Options' button to download the tagged file for Word.)

There are two output formats for the codebook:

  1. Online HTML Codebook

    The online HTML codebook is a set of linked HMTL files that describe each variable. The online codebook contains a sequential index to the variables (with the headings you provide) and an alphabetical index to the variables.

  2. Microsoft Word Codebook

    The SDA codebook program creates a special "tagged" file that can be downloaded and then input into Microsoft Word on your local computer. When you apply a special Word macro to the tagged file, the result is an SDA codebook in Word format that can be printed and/or made available in the SDA archive for downloading by users. The Word codebook has a table of contents which lists all of the variables in sequential order (using the headings you provide).

    Instructions for installing the necessary Word macro and for creating the Word codebook are available in the WordMacro document in the online SDA manual.

Codebook Options

(Click on the 'Show/Hide Other Options' button to use these options.)

Generating the Codebooks

After you specify the weight, filter, and stratification options (if any), click on the 'Create Codebook' button. This will run the SDA 'xcodebk' program, which creates both the online HTML codebook and the tagged file for creating a Word codebook.

If you want to create a Word codebook, you must download the tagged file and input it into Microsoft Word on your computer. Then you can upload the Word file (with the suffix '.doc') back into the archive, so that users can view it and download it.

Set Up the Study in the SDA Archive

After you have created an SDA dataset and the codebooks, you need to specify the options that will be available for users to access the data online. Then you need to incorporate the study's URL into your archive page.

Final Steps

Creating a Web Page to Access Your Dataset

Presumably, you already have (or will create) an HTML file that contains links to various SDA datasets. If you are not sure how to make such an HTML file, you can create a simple file named 'myarchive.htm' to access your SDA dataset by following these steps:

  1. Create a new text file on your computer named 'myarchive.txt', and open it.

  2. Copy the following lines and paste them into that new text file.
    <html> <head> <title>My SDA Archive</title> </head> <body> <h1>My SDA Archive</h1> <h2>Select a Study</h2> <ul> <li> (Replace this line by the HTML code generated by the SDA Archiver.) </ul> </body> </html>

  3. Copy the HTML code generated by the Archiver into the text file, replacing the indicated line.
    (The line to copy is the one that appears after you click the 'Finish Archiving Study' button. The line before it says, "Copy this HTML code to your Web page.")

  4. Save the text file 'myarchive.txt'

  5. Rename that file to 'myarchive.htm'
    (Answer 'Yes' to the query about changing the file name extension.)
If you now double-click on the file 'myarchive.htm', that file should start up in a browser. Click on the link to your study, and SDA should start up.

(You can change the name of this file and the text contained in the file, but be sure NOT to change the URL that links to the study.)