SDA 3.5 Documentation for Q4TODDL BATCH


Summary of batch keywords for Q4TODDL


q4toddl -b batchfile [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 keywords used to specify the various options in a batch file are given here. See the main Q4TODDL document for a general discussion of the program and its options.

The Q-language files to be processed can be specified either on the command line or with the ‘QFile=’ keyword. If both methods are used, files specified with the ‘QFile=" keyword are processed before the files given on the command line.


The batch file contains specifications for the run. These specifications are given in the form "keyword = something" or just "keyword". Keywords may be given in any order, one to a line. The valid keywords are as follows, with significant characters (usually only the first letter) shown in capital letters:

1. Keywords that require something to be specified

Keyword       Possible Specification          Default (if no keyword)

Errorfile=    Name of alternate file for      Use ‘Q4TODDL.MSG’
                diagnostic messages

Layout=       Name of alternate layout file   Use ‘LAYOUT’

Output=       Name of file for DDL output     Output sent to screen

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

QFile=        Name of Q-language file(s)      Take filenames only
                                                from command line

Studydefs=    Name of alternate study         Use ‘SDEFS’
                definition file

Varlist=      Name of alternate file with     Use ‘VARLIST’
                list of variables

Map=a:b,c:d   Map layout record numbers       Use record numbers as
                (If a,b,c,d are integers,       given in layout file
                layout record a becomes b,
                layout record c becomes d)

2. Keywords that only need to be mentioned

The following keywords can either be written out alone on a line or can be given in the form "keyword=Yes". If the keyword is not mentioned, the corresponding option is not put into effect.

Keyword             Meaning

Appending     Convert variable locations to a single long record

Catselim      Do not output category labels

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

Inventory     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’.

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

QUesfull      Include the full text of the items in the ‘text=’

Report        Report variables missing from Q-language files

Textelim      Do not output ‘text=’ segments

9fill         Set ‘md1’ to width filled with nines

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

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


Keywords can be abbreviated down to the number of characters required to differentiate them from other keywords. Usually only one character is required. The keyword for the alternate layout file, for instance, can be given as "layout=" or "lay=" or even "l=". Either upper or lower case may be used.


The only keyword that should be repeated is the ‘QFile=’ keyword. If there is not enough room on a line to list all of the desired Q-language input files, that keyword can be repeated on a new line, and more files can be listed. In such a case the second list of files is appended to the first list. If other keywords are repeated, the second specification will override the first.


Anything on a line beginning with ‘#’ is ignored by the batch processor and can therefore be used for comments. Blank lines are also ignored.


1. Basic example

qfiles = file1.q file2.q
output = myddl

2. A more complicated example

# repeat the ‘qfile’ keyword; use full paths (MS-DOS syntax)
qfile = file1.q
qfile = c:\project\e-inst\file2.q

layout = mylayout
output = newddl

# specify prefix and record mapping
map = 12:1, 15:2



Q4TODDL General discussion of Q4TODDL

CSM, UC Berkeley
April 12, 2011