SDA 3.4 Documentation for Q4TODDL COMMAND


Summary of command-line options for Q4TODDL


q4toddl [-options] Q_files


Q4TODDL converts version 3 or 4 CASES Q-language files to the Data Description Language (DDL). The program can be run with a batch file or by using command-line arguments. The flags or arguments used to specify the various options on the command line are given here.

The Q-language files to be processed must be named on the command line after any options are specified. See the main Q4TODDL document for a general discussion of the program and its options.


The options are specified on the command line in the form
"-flag something" or just "-flag", where "flag" is a single character. Options can be given in any order, separated by one or more spaces or tabs. The valid flags are as follows:

1. Flags that require something to be specified (after an optional space or tab)

 Flag         Possible Specification          Default (if no flag)
  -e          Name of alternate file for      Use ‘Q4TODDL.MSG’
                diagnostic messages

  -l          Name of alternate layout file   Use ‘LAYOUT’

  -o          Name of file for DDL output     Use standard output

  -p          Prefix for variable names       No prefix
                (1-5 characters)

  -s          Name of alternate study         Use ‘SDEFS’
                definition file

  -v          Name of alternate file with     Use ‘VARLIST’
                list of variables

  -m a:b,c:d  Map layout record numbers       Use record numbers as
                to other values                 given in layout file
                (If a,b,c,d are integers,
                layout record a becomes b,
                layout record c becomes d)

          Note: Put double quotes around the
                a:b pairs if you include
                spaces for readability.

2. Flags that only need to be mentioned

If the flag is given on the command line, the corresponding option is put into effect.

 Flag                     Meaning
  -a          Convert variable locations to a single long record

  -c          Do not output category labels

  -f          Set ‘min’ to the lowest code given in the Q-language
                instrument for each variable

  -i          Save list of items processed (inventory) in the
                file ‘Q4TODDL.IN1’.  If any item names have been
                transformed, a list of the final DDL names is
                saved in the file ‘Q4TODDL.IN2’.

  -n          Include non-input items (if no VARLIST provided)

  -q          Include the full text of the items in the ‘text=’

  -r          Report variables missing from Q-language files

  -t          Do not output ‘text=’ segments

  -9          Set ‘md1’ to width filled with nines

  -8          Set ‘md2’ to width filled with nines, minus 1

  -0          Force ‘-9’ and ‘-8’ options, even if there
                is no matching precode in the Q-file.

  -u          Display the list of command-line flags and their
                meaning (overrides all other options, and prevents
                the program from executing)


The flag associated with each option is the same as the first character of the corresponding batch keyword.


1. Basic run, using default options

Create DDL from one file; no options; display DDL on screen; save diagnostics in ‘Q4TODDL.MSG’ and commands in ‘Q4TODDL.OPT’.

     q4toddl myinst.q

2. Create DDL from ‘file1.q’ and ‘file2.q’ using the following options:

     -9: Set ‘md1’ to width filled with nines
     -8: Set ‘md2’ to width filled with nines, minus 1
     -f: Set ‘min’ to lowest code given in Q-language instrument for
           each variable
     -o: Put DDL output into the file ‘myddl’

     q4toddl -9 -8 -f -o myddl  file1.q file2.q

3. Create DDL from all the .q files, using the following options:

     -i: Put inventory of items processed into the file ‘Q4TODDL.IN1’
           (and the transformed DDL names into ‘Q4TODDL.IN2’)
     -o: Put DDL output into the file ‘newddl’
     -p: Put the prefix ‘var’ before all item names
     -m: Map layout record 12 to 1, 15 to 2, and the zero record to 3
     -r: Report variables missing from Q-language files

     q4toddl -i -o newddl -p var -m "12:1,15:2,0:3" -r  *.q

CSM, UC Berkeley
January 25, 2010