'SPSS AnswerNet: Result Solution ID: 100007812 'Product: SPSS Tables 'Title: Variable names don't appear when creating a table 'Description: 'Q. 'I am running SPSS 8.0.2 Or higher For Windows. I created a table 'And I wanted the variable names To appear In the Output, 'but they don't. I looked under the Options->Output 'Labels window And I have Names selected For the "Variables 'In Labels Shown As" window. What is wrong? 'A. 'There Is a problem In SPSS 8.0.2 For Windows And later versions, 'but it can easily fixed by the user. Simply assign variable 'labels To the variables, And those variable labels can be the 'variable names themselves. For example, 'VARIABLE LABELS race "Race" gender "Gender". 'Then, when using SPSS Tables, the variable Name will 'appear In the Output. 'If you have many variables that don't have variable labels, 'assigning a variable label For Each of these variables may 'be cumbersome. Here Is a script that you may copy, paste 'into a New script window, And save In the Scripts folder of 'your SPSS directory. (Be sure To give it an .sbs extension.) 'Then, when you run this script, SPSS will assign the variable 'Name To those variables that Do Not have labels. Option Explicit Sub Main ' This script is to be run before you run the SPSS Tables commands. ' This script will look at the data file, find which variables do not ' have variable labels, and then run a VARIABLE LABELS command that ' inserts the variable name as the label. ' Declare variables and get the variable list: Dim objSpssInfo As ISpssInfo Set objSpssInfo = objSpssApp.SpssInfo ' Get the number of variables: Dim lngNumber As Long Dim i As Long Dim rotulo, comando As String lngNumber = objSpssInfo.NumVariables comando = "VARIABLE LABELS " For I = 0 To lngNumber - 1 rotulo=objspssinfo.VariableLabelAt(i) If rotulo = "" Then comando = comando + objspssinfo.VariableAt(i)+ " '" + objspssinfo.VariableAt(i)+ "' /" Next comando = comando + "." objSpssApp.ExecuteCommands comando, True End Sub