After reading this most recent post, I've gone back to thinking that what you really want is SPLIT FILE, not two separate datasets. If so, try something like this:
NEW FILE.
DATASET CLOSE ALL.
* Change path to point to folder with SPSS sample datasets.
GET FILE = "C:\SPSSdata\survey_sample.sav".
DATASET NAME original.
COMPUTE Row = $CASENUM.
COMPUTE Half = MOD($CASENUM, 2) EQ 1.
RECODE Half (0=2).
FORMATS Row (F5.0) / Half (F1).
LIST Row Half /CASES=FROM 1 to 10.
SORT CASES BY Half.
SPLIT FILE BY Half.
FREQUENCIES Sex.
SPLIT FILE OFF.
The RECODE command is not really necessary, but some folks might find it easier to number the halves 1-2 rather than 0-1.
Here is the output from the LIST command:
Row Half
1 1
2 2
3 1
4 2
5 1
6 2
7 1
8 2
9 1
10 2
Number of cases read: 10 Number of cases listed: 10
And here is the output from FREQUENCIES:


If you want two separate tables, you can add SEPARATE BY as an option for SPLIT FILE. It's in the FM (i.e., the Fine Manual). ;-)
------------------------------
Bruce Weaver
------------------------------
Original Message:
Sent: Tue August 05, 2025 02:32 PM
From: Frank
Subject: How to select every other case in in SPSS data
Thank you,
I did the following in the first half:
compute half = mod($casenum, 2) eq 1.
filter by half.
freq jobcat.
I did the following in the second half, but all cases were deselected..
compute half = mod($casenum, 2) eq 0.
filter by half.
freq jobcat.
I must be missing something...
------------------------------
Dr. Frank
Professor
UMass
Original Message:
Sent: Mon August 04, 2025 10:19 PM
From: Jon Peck
Subject: How to select every other case in in SPSS data
The COMPUTE will generate a variable whose values alternate 0 (false) and 1 (true). You can confirm that in the Data Editor. Then you can use SELECT or Data > Select Cases to select just the 1 cases or just the 0 cases either in the active dataset or in a new one according to the choice in Select Cases.
The actual selection will happen on the next data pass. The data will be passed when you run a procedure or an EXECUTE command.
Original Message:
Sent: 8/4/2025 7:54:00 PM
From: Frank
Subject: RE: How to select every other case in in SPSS data
Just tried this. It deselected all of the cases! Idid not do anything with the condition...
------------------------------
Dr. Frank
Professor
UMass
Original Message:
Sent: Mon August 04, 2025 12:48 PM
From: Jon Peck
Subject: How to select every other case in in SPSS data
The obvious way to do this would be with a condition based on $casenum, but that doesn't work, because $casenum doesn't advance if a case is not selected.
So do this.
compute half = mod($casenum, 2) eq 1.
filter by half.
freq jobcat.
change the condition to 0 for the other half.
--
Original Message:
Sent: 8/4/2025 12:03:00 PM
From: Frank
Subject: How to select every other case in in SPSS data
Hello All,
iO did not see an option to select every other case in in SPSS data. I am trying to split a dat file into two by selecting every other case. I do not want random selections. Thank you in advance.
------------------------------
Dr. Frank
Professor
UMass
------------------------------