TABLES and IGRAPH Command Syntax Converter

If you have command syntax files that contain TABLES syntax that you want to convert to CTABLES syntax and/or IGRAPH syntax that you want to convert to GGRAPH syntax, a simple utility program is provided to help you get started with the conversion process. There are, however, significant functionality differences between TABLES and CTABLES and between IGRAPH and GGRAPH. It is likely that you will find that the utility program cannot convert some of your TABLES and IGRAPH syntax jobs or may generate CTABLES and GGRAPH syntax that produces tables and graphs that do not closely resemble the originals produced by the TABLES and IGRAPH commands. For most tables, you can edit the converted syntax to produce a table closely resembling the original.

The utility program is designed to:

  • Create a new syntax file from an existing syntax file. The original syntax file is not altered.
  • Convert only TABLES and IGRAPH commands in the syntax file. Other commands in the file are not altered.
  • Retain the original TABLES and IGRAPH syntax in commented form.
  • Identify the beginning and end of each conversion block with comments.
  • Identify TABLES and IGRAPH syntax commands that could not be converted.
  • Convert command syntax files that follow either interactive or production mode syntax rules.

This utility cannot convert commands that contain errors. The following other limitations also apply.

TABLES Limitations

The utility program may convert TABLES commands incorrectly under some circumstances, including TABLES commands that contain:

  • Parenthesized variable names with the initial letters "sta" or "lab" in the TABLES subcommand if the variable is parenthesized by itself—for example, var1 by (statvar) by (labvar). These will be interpreted as the (STATISTICS) and (LABELS) keywords.
  • SORT subcommands that use the abbreviations A or D to indicate ascending or descending sort order. These will be interpreted as variable names.

The utility program cannot convert TABLES commands that contain:

  • Syntax errors.
  • OBSERVATION subcommands that refer to a range of variables using the TO keyword (for example, var01 TO var05).
  • String literals broken into segments separated by plus signs (for example, TITLE "My" + "Title").
  • Macro calls that, in the absence of macro expansion, would be invalid TABLES syntax. Since the converter does not expand the macro calls, it treats them as if they were simply part of the standard TABLES syntax.

The utility program will not convert TABLES commands contained in macros. All macros are unaffected by the conversion process.

IGRAPH Limitations

IGRAPH changed significantly in release 16. Because of these changes, some subcommands and keywords in IGRAPH syntax created before that release may not be honored.

The conversion utility program may generate additional syntax that it stores in the INLINETEMPLATE keyword within the GGRAPH syntax. This keyword is created only by the conversion program. Its syntax is not intended to be user-editable.

Using the Conversion Utility Program

The conversion utility program, SyntaxConverter.exe, can be found in the installation directory. It is designed to run from a command prompt. The general form of the command is:


syntaxconverter.exe [path]/inputfilename.sps [path]/outputfilename.sps

You must run this command from the installation directory.

If any directory names contain spaces, enclose the entire path and filename in quotation marks, as in:


syntaxconverter.exe /myfiles/oldfile.sps "/new files/newfile.sps" 

Interactive versus Production Mode Command Syntax Rules

The conversion utility program can convert command files that use interactive or production mode syntax rules.

Interactive. The interactive syntax rules are:

  • Each command begins on a new line.
  • Each command ends with a period (.).

Production mode. The Production Facility and commands in files accessed via the INCLUDE command in a different command file use production mode syntax rules:

  • Each command must begin in the first column of a new line.
  • Continuation lines must be indented at least one space.
  • The period at the end of the command is optional.

If your command files use production mode syntax rules and don't contain periods at the end of each command, you need to include the command line switch -b (or /b) when you run SyntaxConverter.exe, as in:


syntaxconverter.exe -b /myfiles/oldfile.sps /myfiles/newfile.sps

SyntaxConverter Script (Windows Only)

On Windows, you can also run the syntax converter with the script SyntaxConverter.wwd, located in the Samples directory of the installation directory.

  1. From the menus choose:

    Utilities > Run Script...

  2. Navigate to the Samples directory and select SyntaxConverter.wwd.

This will open a simple dialog box where you can specify the names and locations of the old and new command syntax files.