Data dictionary for data imported from Access via ODBC wizard

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Data dictionary for data imported from Access via ODBC wizard

Cleland, Patricia (EDU)
I have a data set which I imported from Access using the ODBC wizard. When I run the syntax below  to produce an 'old fashioned' data dictionary

BEGIN PROGRAM.
import spss, spssaux, DisplayDict
print ' '
print "Data Dictionary for:", spssaux.GetDatasetInfo()
print ' '
print "Number of Variables:", spss.GetVariableCount()
print ' '
DisplayDict.dictionary(alphaorder=False)
END PROGRAM.

I get the following result:

Var1     Index: 0        Variable 1
                Measurement Level: nominal Type: string Format: A100
                Missing Values:
                 Attributes:
                  $ODBC.Type    12
                  $ODBC.Size    100
                  $ODBC.Name  Variable1
                  $ODBC.Table   Database

I don't need the lines that include Attributes ($ODBC.Type to $ODBC.Table), but I have no idea how to prevent them from appearing.  

Any help would be appreciated.

Pat

====================To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Data dictionary for data imported from Access via ODBC wizard

Peck, Jon
You can choose which dictionary items appear in the output.  To get what you are getting now but not attributes, change one line
DisplayDict.dictionary(alphaorder=False, attributes=False)

HTH,
Jon Peck

p.s. You can selectively suppress other dictionary properties in a similar way using the parameters named in the dictionary function in the DisplayDict.py module.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Cleland, Patricia (EDU)
Sent: Friday, April 04, 2008 2:32 PM
To: [hidden email]
Subject: [SPSSX-L] Data dictionary for data imported from Access via ODBC wizard

I have a data set which I imported from Access using the ODBC wizard. When I run the syntax below  to produce an 'old fashioned' data dictionary

BEGIN PROGRAM.
import spss, spssaux, DisplayDict
print ' '
print "Data Dictionary for:", spssaux.GetDatasetInfo()
print ' '
print "Number of Variables:", spss.GetVariableCount()
print ' '
DisplayDict.dictionary(alphaorder=False)
END PROGRAM.

I get the following result:

Var1     Index: 0        Variable 1
                Measurement Level: nominal Type: string Format: A100
                Missing Values:
                 Attributes:
                  $ODBC.Type    12
                  $ODBC.Size    100
                  $ODBC.Name  Variable1
                  $ODBC.Table   Database

I don't need the lines that include Attributes ($ODBC.Type to $ODBC.Table), but I have no idea how to prevent them from appearing.

Any help would be appreciated.

Pat

=======
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD