Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Saving variable view contents

2,258 views
Skip to first unread message

santa claws

unread,
Nov 16, 2009, 11:02:49 AM11/16/09
to
Hi! I have a simple question: how do I export the whole content of
variable view to a tab delimited file? I can export all my data, but
what about variable view? I'd like to save all the contents, value
labels included... saving to a file from the view doesn't do the
job...

Thanks!

Bruce Weaver

unread,
Nov 16, 2009, 1:43:36 PM11/16/09
to

I don't know if there is a more straightforward method, but you could
do this:

1. Use OMS to send the output from DISPLAY DICTIONARY to a couple of
SPSS datasets (one containing the "Variable Information" table, the
other containing the "Variable Values" table).

2. Merge those files (with MATCH FILES).

3. Re-order the variables if desired (and delete any that are not
wanted).

4. Export the data to a tab-delimited text file.

--
Bruce Weaver
bwe...@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/Home
"When all else fails, RTFM."

JKPeck

unread,
Nov 16, 2009, 6:53:35 PM11/16/09
to
On Nov 16, 11:43 am, Bruce Weaver <bwea...@lakeheadu.ca> wrote:
> On Nov 16, 11:02 am, santa claws <rantingn...@gmail.com> wrote:
>
> > Hi! I have a simple question: how do I export the whole content of
> > variable view to a tab delimited file? I can export all my data, but
> > what about variable view? I'd like to save all the contents, value
> > labels included... saving to a file from the view doesn't do the
> > job...
>
> > Thanks!
>
> I don't know if there is a more straightforward method, but you could
> do this:
>
> 1. Use OMS to send the output from DISPLAY DICTIONARY to a couple of
> SPSS datasets (one containing the "Variable Information" table, the
> other containing the "Variable Values" table).
>
> 2. Merge those files (with MATCH FILES).
>
> 3. Re-order the variables if desired (and delete any that are not
> wanted).
>
> 4. Export the data to a tab-delimited text file.
>
> --
> Bruce Weaver
> bwea...@lakeheadu.cahttp://sites.google.com/a/lakeheadu.ca/bweaver/Home

> "When all else fails, RTFM."

Note that if you want to save the metadata to use with another
dataset, you can just use Apply Dictionary. No need to rerun the
syntax. That's Copy Data Properties on the Data menu.

The CODEBOOK command is a newer and nicer alternative to DISPLAY
DATA, although that command certainly works.

If you use programmability, you can easily write an xml description of
the entire dictionary to a file. For example,
begin program.
import spss
spss.CreateXPathDictionary('mydict")
spss.GetXmlUtf16("mydict", "c:/temp/mydict.xml")
end program.

It will have all the dictionary information, but you can't use it
directly in SPSS to create a new dictionary.

HTH,
Jon Peck

santa claws

unread,
Nov 17, 2009, 9:01:38 AM11/17/09
to

Thanks Jon!

Unfortunately, I am using v13, and I can't find a way of using your
script... I am a newbie though... Am I missing something?

santa claws

unread,
Nov 17, 2009, 9:57:31 AM11/17/09
to
On Nov 16, 7:43 pm, Bruce Weaver <bwea...@lakeheadu.ca> wrote:
> On Nov 16, 11:02 am, santa claws <rantingn...@gmail.com> wrote:
>
> > Hi! I have a simple question: how do I export the whole content of
> > variable view to a tab delimited file? I can export all my data, but
> > what about variable view? I'd like to save all the contents, value
> > labels included... saving to a file from the view doesn't do the
> > job...
>
> > Thanks!
>
> I don't know if there is a more straightforward method, but you could
> do this:
>
> 1. Use OMS to send the output from DISPLAY DICTIONARY to a couple of
> SPSS datasets (one containing the "Variable Information" table, the
> other containing the "Variable Values" table).
>
> 2. Merge those files (with MATCH FILES).
>
> 3. Re-order the variables if desired (and delete any that are not
> wanted).
>
> 4. Export the data to a tab-delimited text file.
>
> --
> Bruce Weaver
> bwea...@lakeheadu.cahttp://sites.google.com/a/lakeheadu.ca/bweaver/Home

> "When all else fails, RTFM."

Thanks Bruce!

Your idea was just fine, I saved them as HTML and now I can use them
as I wish.

Thank you!

JKPeck

unread,
Nov 17, 2009, 2:36:45 PM11/17/09
to

Programmability requires at least SPSS v14, so I'm glad that the html
solution works for you. CODEBOOK was new in V17.

Bruce Weaver

unread,
Nov 17, 2009, 3:58:49 PM11/17/09
to
On Nov 17, 2:36 pm, JKPeck <jkp...@gmail.com> wrote:

> Programmability requires at least SPSS v14, so I'm glad that the html
> solution works for you.  CODEBOOK was new in V17.


Ah, OK. That explains why I didn't know about CODEBOOK. I've only
had v17 for a short time.

Jon, how feasible would it be to add to the "Overview" help screens
(under Help - Topics - Index) a note indicating when a command was
added, and perhaps which module it belongs to? The latter info
appears in the Command Syntax Reference manual in the form "X is
available in the Y option" (e.g., MIXED is available in the Advanced
Statistics option"), but opening the PDF file takes longer than going
to the other Help windows.

Cheers,
Bruce
--
Bruce Weaver
bwe...@lakeheadu.ca

JKPeck

unread,
Nov 17, 2009, 11:04:00 PM11/17/09
to
On Nov 17, 1:58 pm, Bruce Weaver <bwea...@lakeheadu.ca> wrote:
> On Nov 17, 2:36 pm, JKPeck <jkp...@gmail.com> wrote:
>
> > Programmability requires at least SPSS v14, so I'm glad that the html
> > solution works for you.  CODEBOOK was new in V17.
>
> Ah, OK.  That explains why I didn't know about CODEBOOK.  I've only
> had v17 for a short time.
>
> Jon, how feasible would it be to add to the "Overview" help screens
> (under Help - Topics - Index) a note indicating when a command was
> added, and perhaps which module it belongs to?   The latter info
> appears in the Command Syntax Reference manual in the form "X is
> available in the Y option" (e.g., MIXED is available in the Advanced
> Statistics option"), but opening the PDF file takes longer than going
> to the other Help windows.
>
> Cheers,
> Bruce
> --
> Bruce Weaver
> bwea...@lakeheadu.cahttp://sites.google.com/a/lakeheadu.ca/bweaver/Home

> "When all else fails, RTFM."

I've passed your suggestion on to the Pubs team. Personally, I like
using the PDF, but I know many other like the alternative form.

Stephan C. Telka

unread,
Dec 10, 2009, 10:49:38 AM12/10/09
to
What is "OMS" that you mention in step one?


On Nov 16, 1:43 pm, Bruce Weaver <bwea...@lakeheadu.ca> wrote:
> On Nov 16, 11:02 am, santa claws <rantingn...@gmail.com> wrote:
>
> > Hi! I have a simple question: how do I export the whole content of
> > variable view to a tab delimited file? I can export all my data, but
> > what about variable view? I'd like to save all the contents, value
> > labels included... saving to a file from the view doesn't do the
> > job...
>
> > Thanks!
>
> I don't know if there is a more straightforward method, but you could
> do this:
>
> 1. Use OMS to send the output from DISPLAY DICTIONARY to a couple of
> SPSS datasets (one containing the "Variable Information" table, the
> other containing the "Variable Values" table).
>
> 2. Merge those files (with MATCH FILES).
>
> 3. Re-order the variables if desired (and delete any that are not
> wanted).
>
> 4. Export the data to a tab-delimited text file.
>
> --
> Bruce Weaver

> bwea...@lakeheadu.cahttp://sites.google.com/a/lakeheadu.ca/bweaver/Home

Bruce Weaver

unread,
Dec 10, 2009, 10:54:25 AM12/10/09
to
On Dec 10, 10:49 am, "Stephan C. Telka" <stephan.te...@gmail.com>
wrote:

> What is "OMS" that you mention in step one?


OMS is short for Output Management System. The GUI interface for
using it is found in the Utilities menu (OMS Control Panel, and OMS
Identifiers). I believe there are examples of how to use OMS in
Raynald's Data Management book, which is freely available as a PDF on
the SPSS website.

--
Bruce Weaver
bwe...@lakeheadu.ca

0 new messages