Saving variable names from Data Viewer to file???

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

Saving variable names from Data Viewer to file???

ksven
This post was updated on .
Hi there -
Is there a way to "export" variable labels from the viewer to a separate file? I tried playing around with oms but without success.
Thanks!
Sven
Reply | Threaded
Open this post in threaded view
|

Re: Macro that generates macro containing (all) variable labels/or saving variable labels to file

Jon K Peck

Have you looked into APPLY DICTIONARY?  It can copy variable labels and other metadata from one dataset to another or within a dataset.

Regards,

Jon Peck
SPSS, an IBM Company
[hidden email]
312-651-3435



From: ksven <[hidden email]>
To: [hidden email]
Date: 02/23/2010 08:56 AM
Subject: [SPSSX-L] Macro that generates macro containing (all) variable              labels/or              saving variable labels to file
Sent by: "SPSSX(r) Discussion" <[hidden email]>





Hi there -
I am trying to write a macro that generates a new macro, which contains the
variable labels of specific variables I am interested in. This new macro
could be used to (re-) label variables with a minimum of syntax needed,
including NOT having to write out all variable labels.
Alternatively there may be a way to "export" variable labels from the viewer
to a separate file? I tried playing around with oms but without success.
Thanks!
Sven
--
View this message in context:
http://old.nabble.com/Macro-that-generates-macro-containing-%28all%29-variable-labels-or-saving-variable-labels-to-file-tp27705398p27705398.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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: Macro that generates macro containing (all) variable labels/or saving variable labels to file

ksven
Thanks Jon -
the problem with that approach is that it applies it to all variables. You also need to have the same variable  names in both files and do not have any flexibility in adding to the variable labels - such as adding a "recoded" statement to all of them if you do not have a variable containing the variable names .... hm.
Sven


Jon K Peck wrote
Have you looked into APPLY DICTIONARY?  It can copy variable labels and
other metadata from one dataset to another or within a dataset.

Regards,

Jon Peck
SPSS, an IBM Company
peck@us.ibm.com
312-651-3435



From:
ksven <svenklingemann@gmail.com>
To:
SPSSX-L@LISTSERV.UGA.EDU
Date:
02/23/2010 08:56 AM
Subject:
[SPSSX-L] Macro that generates macro containing (all) variable  labels/or
           saving variable labels to file
Sent by:
"SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>



Hi there -
I am trying to write a macro that generates a new macro, which contains
the
variable labels of specific variables I am interested in. This new macro
could be used to (re-) label variables with a minimum of syntax needed,
including NOT having to write out all variable labels.
Alternatively there may be a way to "export" variable labels from the
viewer
to a separate file? I tried playing around with oms but without success.
Thanks!
Sven
--
View this message in context:
http://old.nabble.com/Macro-that-generates-macro-containing-%28all%29-variable-labels-or-saving-variable-labels-to-file-tp27705398p27705398.html

Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (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: Macro that generates macro containing (all) variable labels/or saving variable labels to file

Jon K Peck

Jon Peck
SPSS, an IBM Company
[hidden email]
312-651-3435



From: ksven <[hidden email]>
To: [hidden email]
Date: 02/23/2010 09:30 AM
Subject: Re: [SPSSX-L] Macro that generates macro containing (all) variable              labels/or saving variable labels to file
Sent by: "SPSSX(r) Discussion" <[hidden email]>





Thanks Jon -
the problem with that approach is that it applies it to all variables. You
also need to have the same variable  names in both files and do not have any
flexibility in adding to the variable labels - such as adding a "recoded"
statement to all of them if you do not have a variable containing the
variable names .... hm.
Sven

>>>Not so.  Since around V13 or 14 you can select the variables, and you can match up variables with different names.  Try the Data>Copy Data Properties wizard to get started.



Jon K Peck wrote:
>
> Have you looked into APPLY DICTIONARY?  It can copy variable labels and
> other metadata from one dataset to another or within a dataset.
>
> Regards,
>
> Jon Peck
> SPSS, an IBM Company
> [hidden email]
> 312-651-3435
>
>
>
> From:
> ksven <[hidden email]>
> To:
> [hidden email]
> Date:
> 02/23/2010 08:56 AM
> Subject:
> [SPSSX-L] Macro that generates macro containing (all) variable  labels/or
>            saving variable labels to file
> Sent by:
> "SPSSX(r) Discussion" <[hidden email]>
>
>
>
> Hi there -
> I am trying to write a macro that generates a new macro, which contains
> the
> variable labels of specific variables I am interested in. This new macro
> could be used to (re-) label variables with a minimum of syntax needed,
> including NOT having to write out all variable labels.
> Alternatively there may be a way to "export" variable labels from the
> viewer
> to a separate file? I tried playing around with oms but without success.
> Thanks!
> Sven
> --
> View this message in context:
>
http://old.nabble.com/Macro-that-generates-macro-containing-%28all%29-variable-labels-or-saving-variable-labels-to-file-tp27705398p27705398.html
>
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> 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
>
>
>
>

--
View this message in context:
http://old.nabble.com/Macro-that-generates-macro-containing-%28all%29-variable-labels-or-saving-variable-labels-to-file-tp27705398p27705997.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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: Macro that generates macro containing (all) variable labels/or saving variable labels to file

ksven
OK -
this is a clumsy way but it works (assuming you want the variable labels of I1 to I3 as a unique variables in a new spss file):

OMS
/SELECT TABLES
/IF COMMANDS = ["Frequencies"] subtypes=["Frequencies"]
/DESTINATION FORMAT = SAV
OUTFILE = 'P:\vars.sav'.
freq VAR=I1 I2 I3.
omsend.

get 'P:\vars.sav' /keep=label_ var2.
***Var 2 gets created and by selecting 1.00 you delete all other duplicates.
sel if (var2="1.00").
save outfile='P:\vars.sav' /keep=label_.
exe.

Best,
Sven