Problem with update command syntax

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

Problem with update command syntax

Baker, Harley

Greetings!

 

I am having difficulty with the Update command syntax and am hoping someone can show me the error of my ways. I am trying to update a file with values from a separate file. Below is the syntax:

 

match files

     file  = '/Users/Professional/Desktop/Final.05.21.2021/Processed Data Files'

+            '/06.13.2021_master.sav'

    /table = '/Users/Professional/Desktop/Final.05.21.2021/Processed Data Files'

+            '/06.13.2021_all imputed table.sav'

    /by      imputation_ id

    /map.

 

execute.

 

The map output indicates the command was “successful” – showing which file contributed the final values in the resultant matched file. Yet, when I do a file compare and run descriptives on the resultant file, it only has the values from the master file, none of which were updated or replaced by the data in the table. I have checked both of these files and there are no problems with them individually. The syntax looks correct, and SPSS tells me it was successful, yet it doesn’t work. Just in case there is some funky syntax error, I have also done this from the pull-down menus with the same result. I am temporarily stumped and cannot go any further on this project withour resolving this issue.

 

I am running v27 on an iMac using Big Sur 11.4. Any insight and help would be appreciated. I am happy to send the syntax and output files to interested parties. Thank you very much!

 

Harley

 

Dr. Harley Baker

Professor Emeritus of Psychology

California State University Channel Islands

 

[hidden email]

 

 

 

 

 

 

 

 

===================== 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: Problem with update command syntax

Maguin, Eugene

Harley,

Would you try the command with update rather than match files. The update documentation shows this statement

 

UPDATE is designed to update values of existing variables for existing cases. Use MATCH FILES to add

new variables to a data file and ADD FILES to add new cases.

 

And that sounds like what you are doing because the variables to be updated already exist in the master file.

 

Gene Maguin

 

From: SPSSX(r) Discussion <[hidden email]> On Behalf Of Baker, Harley
Sent: Sunday, June 13, 2021 4:25 PM
To: [hidden email]
Subject: Problem with update command syntax

 

Greetings!

 

I am having difficulty with the Update command syntax and am hoping someone can show me the error of my ways. I am trying to update a file with values from a separate file. Below is the syntax:

 

match files

     file  = '/Users/Professional/Desktop/Final.05.21.2021/Processed Data Files'

+            '/06.13.2021_master.sav'

    /table = '/Users/Professional/Desktop/Final.05.21.2021/Processed Data Files'

+            '/06.13.2021_all imputed table.sav'

    /by      imputation_ id

    /map.

 

execute.

 

The map output indicates the command was “successful” – showing which file contributed the final values in the resultant matched file. Yet, when I do a file compare and run descriptives on the resultant file, it only has the values from the master file, none of which were updated or replaced by the data in the table. I have checked both of these files and there are no problems with them individually. The syntax looks correct, and SPSS tells me it was successful, yet it doesn’t work. Just in case there is some funky syntax error, I have also done this from the pull-down menus with the same result. I am temporarily stumped and cannot go any further on this project withour resolving this issue.

 

I am running v27 on an iMac using Big Sur 11.4. Any insight and help would be appreciated. I am happy to send the syntax and output files to interested parties. Thank you very much!

 

Harley

 

Dr. Harley Baker

Professor Emeritus of Psychology

California State University Channel Islands

 

[hidden email]

 

 

 

 

 

 

 

 

 

 

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: Problem with update command syntax

Baker, Harley

Thanks, Gene

 

I changed the match to update and the table to file in the syntax and it worked perfectly. Don’t know what I was thinking when I used match instead of update even when I was describing it as update. Too long looking at it, too long without coffee, etc.

 

I knew all it would take was a pair of fresh eyes.

 

Harley

 

Dr. Harley Baker

Professor Emeritus of Psychology

California State University Channel Islands

 

[hidden email]

 

 

From: "SPSSX(r) Discussion" <[hidden email]> on behalf of "Maguin, Eugene" <[hidden email]>
Reply-To: "Maguin, Eugene" <[hidden email]>
Date: Sunday, June 13, 2021 at 1:47 PM
To: "[hidden email]" <[hidden email]>
Subject: Re: Problem with update command syntax

 

CAUTION: This email originated from outside of CSUCI. Do not click links or open attachments unless you validate the sender and know the content is safe. Contact ITS if you have any concerns

 

Harley,

Would you try the command with update rather than match files. The update documentation shows this statement

 

UPDATE is designed to update values of existing variables for existing cases. Use MATCH FILES to add

new variables to a data file and ADD FILES to add new cases.

 

And that sounds like what you are doing because the variables to be updated already exist in the master file.

 

Gene Maguin

 

From: SPSSX(r) Discussion <[hidden email]> On Behalf Of Baker, Harley
Sent: Sunday, June 13, 2021 4:25 PM
To: [hidden email]
Subject: Problem with update command syntax

 

Greetings!

 

I am having difficulty with the Update command syntax and am hoping someone can show me the error of my ways. I am trying to update a file with values from a separate file. Below is the syntax:

 

match files

     file  = '/Users/Professional/Desktop/Final.05.21.2021/Processed Data Files'

+            '/06.13.2021_master.sav'

    /table = '/Users/Professional/Desktop/Final.05.21.2021/Processed Data Files'

+            '/06.13.2021_all imputed table.sav'

    /by      imputation_ id

    /map.

 

execute.

 

The map output indicates the command was “successful” – showing which file contributed the final values in the resultant matched file. Yet, when I do a file compare and run descriptives on the resultant file, it only has the values from the master file, none of which were updated or replaced by the data in the table. I have checked both of these files and there are no problems with them individually. The syntax looks correct, and SPSS tells me it was successful, yet it doesn’t work. Just in case there is some funky syntax error, I have also done this from the pull-down menus with the same result. I am temporarily stumped and cannot go any further on this project withour resolving this issue.

 

I am running v27 on an iMac using Big Sur 11.4. Any insight and help would be appreciated. I am happy to send the syntax and output files to interested parties. Thank you very much!

 

Harley

 

Dr. Harley Baker

Professor Emeritus of Psychology

California State University Channel Islands

 

[hidden email]

 

 

 

 

 

 

 

 

 

 

===================== 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

===================== 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: Problem with update command syntax

Ives, Melissa L

Glad you found the solution.


For Match, order of files matters. 

If the two files contain the same variables, only the values from the first file will be kept.

 

In your example, if the /table file contained the ‘new’ data, that would result in the behavior you describe.

 

Melissa

 

From: SPSSX(r) Discussion <[hidden email]> On Behalf Of Baker, Harley
Sent: Sunday, June 13, 2021 5:00 PM
To: [hidden email]
Subject: Re: [SPSSX-L] Problem with update command syntax

 

EXTERNAL EMAIL: This email originated from outside of the organization. Do not click any links or open any attachments unless you trust the sender and know the content is safe.

Thanks, Gene

 

I changed the match to update and the table to file in the syntax and it worked perfectly. Don’t know what I was thinking when I used match instead of update even when I was describing it as update. Too long looking at it, too long without coffee, etc.

 

I knew all it would take was a pair of fresh eyes.

 

Harley

 

Dr. Harley Baker

Professor Emeritus of Psychology

California State University Channel Islands

 

[hidden email]

 

 

From: "SPSSX(r) Discussion" <[hidden email]> on behalf of "Maguin, Eugene" <[hidden email]>
Reply-To: "Maguin, Eugene" <[hidden email]>
Date: Sunday, June 13, 2021 at 1:47 PM
To: "[hidden email]" <[hidden email]>
Subject: Re: Problem with update command syntax

 

CAUTION: This email originated from outside of CSUCI. Do not click links or open attachments unless you validate the sender and know the content is safe. Contact ITS if you have any concerns

 

Harley,

Would you try the command with update rather than match files. The update documentation shows this statement

 

UPDATE is designed to update values of existing variables for existing cases. Use MATCH FILES to add

new variables to a data file and ADD FILES to add new cases.

 

And that sounds like what you are doing because the variables to be updated already exist in the master file.

 

Gene Maguin

 

From: SPSSX(r) Discussion <[hidden email]> On Behalf Of Baker, Harley
Sent: Sunday, June 13, 2021 4:25 PM
To: [hidden email]
Subject: Problem with update command syntax

 

Greetings!

 

I am having difficulty with the Update command syntax and am hoping someone can show me the error of my ways. I am trying to update a file with values from a separate file. Below is the syntax:

 

match files

     file  = '/Users/Professional/Desktop/Final.05.21.2021/Processed Data Files'

+            '/06.13.2021_master.sav'

    /table = '/Users/Professional/Desktop/Final.05.21.2021/Processed Data Files'

+            '/06.13.2021_all imputed table.sav'

    /by      imputation_ id

    /map.

 

execute.

 

The map output indicates the command was “successful” – showing which file contributed the final values in the resultant matched file. Yet, when I do a file compare and run descriptives on the resultant file, it only has the values from the master file, none of which were updated or replaced by the data in the table. I have checked both of these files and there are no problems with them individually. The syntax looks correct, and SPSS tells me it was successful, yet it doesn’t work. Just in case there is some funky syntax error, I have also done this from the pull-down menus with the same result. I am temporarily stumped and cannot go any further on this project withour resolving this issue.

 

I am running v27 on an iMac using Big Sur 11.4. Any insight and help would be appreciated. I am happy to send the syntax and output files to interested parties. Thank you very much!

 

Harley

 

Dr. Harley Baker

Professor Emeritus of Psychology

California State University Channel Islands

 

[hidden email]

 

 

 

 

 

 

 

 

 

 

===================== 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

===================== 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




This correspondence contains proprietary information some or all of which may be legally privileged; it is for the intended recipient only. If you are not the intended recipient you must not use, disclose, distribute, copy, print, or rely on this correspondence and completely dispose of the correspondence immediately. Please notify the sender if you have received this email in error. NOTE: Messages to or from the State of Connecticut domain may be subject to the Freedom of Information statutes and regulations.

===================== 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