bugPSPP - Bugs: bug #66899, how to merge two datasets based on...

 
 

bug #66899: how to merge two datasets based on id using syntax? is it possible?

Submitter:  elias tsolis <estatistics>
Submitted:  Wed 12 Mar 2025 11:46:02 AM UTC
   
 
Category:  Syntax Parser Severity:  5 - Average
Status:  None Assigned to:  None
Open/Closed:  Open Release:  None
Effort:  0.00
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 12 Mar 2025 11:54:39 AM UTC, comment #1: 

I found the solution to merge two datasets using an id variable:

MATCH FILES
/FILE="/mnt/Projects/d1.sav"
/FILE="/mnt/Projects/d2.sav"
ΒΥ ID
EXECUTE.

However, i cant understand the use of "add files".


elias tsolis <estatistics>
Wed 12 Mar 2025 11:46:02 AM UTC, original submission:  

I want to merge two datasets based on the same id.
Lets say ID var is common in both files: dt1 (20 vars +id) and dt2 (10 vars+id) with 100 cases.
I expect the new file to have 30 vars +id and 100 cases.
Is that possible?


The second "GET DATA" overwrite/delete all the first data. I will expect to add the vars sided to the existing vars, either is that right or wrong, if number of cases match or not. OR better to declare if it is a merge or not, for example: MERGE=on.

GET DATA /TYPE=ODS
   /FILE="/mnt/Projects/dt1.ods"
   /SHEET=INDEX 1
   /CELLRANGE=FULL
   /READNAMES=on.
  
   GET DATA /TYPE=ODS
   /FILE="/mnt/Projects/dt2.ods"
   /SHEET=INDEX 1
   /CELLRANGE=FULL
   /READNAMES=on.
  
 =============================================================================
I expected this command to add vars sided to the 1st data sets' vars. The 1st dataset is properly produced, but the 2nd dataset start at 101th case and goes downward 100 lines instead of starting at 21th var, 1st case after the 1st dataset.
Is that wrong or right?


 
ADD FILES
/FILE="/mnt/Projects/dt1.sav"
/FILE="/mnt/Projects/dt2.sav"
EXECUTE.

What i must do to merge two datasets side-by-side?

elias tsolis <estatistics>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by estatistics (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.14-962f.
    Corresponding source code