|
Diane Putnick wrote:
>
> That helps. I wanted to apply the attributes of one file to another, but
> not all of the variables are overlapping. I was just going to edit the
> syntax once I had it. Will apply dictionary work if the datasets contain
> some differing variables?
>
> Thanks!
> Diane
>
>
Read the fine manual, Diane. Here are the first few lines of the syntax
chart:
APPLY DICTIONARY FROM [{'savfile'|'dataset'}]
{* }
[/SOURCE VARIABLES = varlist]
[/TARGET VARIABLES = varlist]
[/NEWVARS]
etc
And here is some info from the Help page on the /SOURCE sub-command:
The SOURCE subcommand is used to specify variables in the source file from
which to apply variable definition attributes. The TARGET subcommand is used
to specify variables in the active dataset to which to apply variable
definition attributes.
• All variables specified in the SOURCE subcommand must exist in the source
file.
• If the TARGET subcommand is specified without the SOURCE subcommand, all
variables specified must exist in the source file.
• If the NEWVARS subcommand is specified, variables that are specified in
the SOURCE subcommand that exist in the source file but not in the target
file will be created in the target file as new variables using the variable
definition attributes (variable and value labels, missing values, etc.) from
the source variable.
• For variables with matching name and type, variable definition attributes
from the source variable are applied to the matching target variable.
• If both SOURCE and TARGET are specified, the SOURCE subcommand can specify
only one variable. Variable definition attributes from that single variable
in the SOURCE subcommand are applied to all variables of the matching type.
When applying the attributes of one variable to many variables, all
variables specified in the SOURCE and TARGET subcommands must be of the same
type.
• For variables with matching names but different types, only variable
labels are applied to the target variables.
Example
APPLY DICTIONARY from *
/SOURCE VARIABLES = var1
/TARGET VARIABLES = var2 var3 var4
/NEWVARS.
• Variable definition attributes for var1 in the active dataset are copied
to var2, var3, and var4 in the same dataset if they have a matching type.
• Any variables specified in the TARGET subcommand that do not already exist
are created, using the variable definition attributes of the variable
specified in the SOURCE subcommand.
Example
APPLY DICTIONARY from “lastmonth.sav”
/SOURCE VARIABLES = var1, var2, var3.
• Variable definition attributes from the specified variables in the source
dataset are applied to the matching variables in the active dataset.
• For variables with matching names but different types, only variable
labels from the source variable are copied to the target variable.
• In the absence of a NEWVARS subcommand, no new variables will be created.
-----
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/
"When all else fails, RTFM."
NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.
--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/outputting-variable-and-value-labels-to-sytnax-tp3025423p3030057.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
|