Importing a SLICE file into SPSS

From mtab wikisupport
Jump to: navigation, search

Due to changes in the SPSS import methodology, it is possible that when attempting to run the syntax (.SPS) in SPSS to import an mTAB Sliced data file, you come across an error message. These errors prevent SPSS from loading the Sliced data file. The root cause is simply that SPSS does not know where to locate the data (.DAT) file associated with this syntax.

The following steps address how to rectify this and import the mTAB Sliced file into SPSS.

When you run the syntax (.SPS) file provided by mTAB, messages similar to the following may appear in the SPSS Viewer.

Error # 31 in column 21. Text: MTAB >File not found. >Execution of this command stops.

Error # 100. Command name: VALUE LABELS >This command is not permitted before the beginning of file definition >commands. >Execution of this command stops.

If this occurs, editing the syntax (.SPS) that was generated from the Slice process will resolve the error messages. Begin by opening the syntax (.SPS) file that was created during the Slice process.

The syntax will look like the following example.

Slice importing-a-slice-file-into-SPSS SPSS.jpg

FILE HANDLE MTAB /NAME='mTAB_Demonstration_DB_-_Current_Year.DAT' /LRECL=168.


ID (N)

V1 (F9.4)

V2 (A7)

V3 (N)

V4 (N)

V5 (N)

V6 (N)

V7 (N)

V8 (N)

V9 (N)

V10 (N)

In this example, the Sliced Data file is named 'mTAB_Demonstration_DB_-_Current_Year.DAT’

Next, identify where you have placed the downloaded Slice data (.DAT) file. In most instances, the file will download to the Desktop.

Modify the first line of the syntax by specifying the location of the file before the file name.

For example, if the Sliced file was downloaded to your Desktop, It would actually be C:\Documents and Settings\NAME\Desktop\

Substitute “NAME” in the above example for your specific folder name. This varies for each person.

Also if the Sliced file was not downloaded to your computer’s hard drive, you will need to change C: to the network or other drive letter.

Next, change the opening line in the syntax from 'mTAB_Demonstration_DB_-_Current_Year.DAT’ to ‘C:\Documents and Settings\NAME\Desktop\mTAB_Demonstration_DB_-_Current_Year.DAT’

Again, substitute “NAME” in the above example for your specific folder name.

Slice importing-a-slice-file-into-SPSS name.jpg

Please make a note of the new location of the single quotes. They are now moved to just before C:

When the edits are complete, save the changes to the syntax file (.SPS)

Run the syntax file again in SPSS by clicking RUN-ALL. The syntax file should now run and import the Sliced data into SPSS.

Slice importing-a-slice-file-into-SPSS final-image.jpg