hi,
I have two files to match. One has kids (with mum) info and other has dads (with mum) info. Now both of them also share a common HID column. The data looks like, First File, HID Dad Income Mum 1 A 1000 A1 2 B 3000 B1 3 C 4000 C1 Second File, HID Kid Age Mum 1 X 10 2 Y 12 3 Z 15 2 XX 16 1 YY 17 I want to have an output like HID Kid Age Dad Income Mum 1 X 10 A 1000 A1 2 Y 12 B 3000 B1 3 Z 15 C 4000 C1 2 XX 16 B 3000 B1 1 YY 17 A 1000 A1 I have tried so far (With the help from this group) Match files /file "C:\Users\kids.sav" /table "C:\Users\dads.sav" /by HID Mum EXECUTE Getting the follwoing error messages >Error # 5241 in column 1. Text: EXECUTE >Undefined variable name. Check spelling, verify the existence of this >variable. Has it been dropped or renamed in this command? >This command not executed. >Error # 5123 >The TABLE subcommand is specified without a BY subcommand. A BY subcommand is >required with TABLE subcommands. >Note # 5146 >There is no working file to restore. You must define a working file before >proceeding with your analysis. Any help would be much appreciated. |
Administrator
|
Match files
/file "C:\Users\kids.sav" /table "C:\Users\dads.sav" /by HID Mum . EXECUTE
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Administrator
|
And another command terminator after the EXECUTE, of course!
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Hi,
Used the follwoing syntax Match files /file "C:\Users\kids.sav" /table "C:\Users\dad.sav" /by HID MUM . EXECUTE . in the output file it does say Execute. But where is the output file. None of the file been updated with variables or cases. |
Administrator
|
The second file in your example has a variable called Mum, but it has no data in it. Is that really the case in your actual data file? To get it to work using the first and second files as you showed them earlier in the thread, I had to DROP the empty Mum variable from the second file, and match on HID only.
NOTE that I also had to sort the cases by HID in the second file before using MATCH FILES. NEW FILE. DATASET CLOSE all. DATA LIST list / HID(f5.0) Dad(A3) Income (f5.0) Mum(A3). BEGIN DATA 1 A 1000 A1 2 B 3000 B1 3 C 4000 C1 END DATA. SORT CASES by HID. DATASET NAME Dads. DATA LIST list / HID(f5.0) Kid(A3) Age (f5.0) Mum(A3). BEGIN DATA 1 X 10 " " 2 Y 12 " " 3 Z 15 " " 2 XX 16 " " 1 YY 17 " " END DATA. SORT CASES by HID Kid. DATASET NAME Kids. MATCH FILES /file Kids /rename(Mum=junk) /table Dads /drop=junk /by HID . EXECUTE . DATASET NAME both. DATASET activate both. LIST. OUTPUT: HID Kid Age Dad Income Mum 1 X 10 A 1000 A1 1 YY 17 A 1000 A1 2 XX 16 B 3000 B1 2 Y 12 B 3000 B1 3 Z 15 C 4000 C1 Number of cases read: 5 Number of cases listed: 5
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Bruce,
The Mum variables do have values in the real dataset - that was a typo mistake. few Queries; - in my kids file number of cases 2737087 and dads file has 34768. It should not be a problem I guess. - In my dad file I have some missing values presented in the file as (.) dot. |
Hi,
Used the follwoing syntax to match these files; Match files /file "C:\Users\kids - test.sav" /table "C:\Users\dad - test.sav" /by HID Mum . EXECUTE . it manages to create a output file but just with attribute names. The data is not there. Status bar has a message 'Transformations Pending'. it was there before and Bruce suggested to use Execute command which is already in place. Any idea? Thanks in advance. |
Have you selected the EXECUTE command when executing the code?
If you execute code, press CTRL+R (run all, you can also find this in the toolbar menu at the top of the Syntax edito). The EXECUTE command is only activated if you also select it. If you already did this, I think you have to wait a while longer. As far as I can see your code is OK and should execute correctly (don't forget to sort the files by HID and Mum). You can copy / paste the below code and press CTRL+R. Get file = 'c:\users\kids - test.sav'. Dataset name kids. Sort cases by hid mum (a). Get file = 'c:\users\dad - test.sav'. dataset name dad. Sort cases by hid mum (a). Dataset activate kids. Match files /file = * /table = dad /by hid mum. Execute. Op 15 jul. 2013 om 14:58 heeft "leonleo" <[hidden email]> het volgende geschreven: > Hi, > Used the follwoing syntax to match these files; > > Match files > /file "C:\Users\kids - test.sav" > /table "C:\Users\dad - test.sav" > /by HID Mum . > EXECUTE . > > it manages to create a output file but just with attribute names. The data > is not there. Status bar has a message 'Transformations Pending'. it was > there before and Bruce suggested to use Execute command which is already in > place. > > Any idea? > Thanks in advance. > > > > -- > View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Match-File-error-message-tp5721071p5721166.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 ===================== 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 |
Free forum by Nabble | Edit this page |