The sea of Maybe is something very simple and that always affects us by our database in an increasing way. Today I come across the databases, both are from the same project, the difference is the period in which the information is accessed, the first with 768 records and with a variable (initial) ID from 1 to 768 and the second base with 2758 records and also has the variable (ncuest) of ID from 1 to 2758. In the process of cleaning and processing the bases were joined and that's when my problem happened, at some point the total base was ordered by variable variable in specific, ex. genre and now that I want to go back to how I was I do not achieve What I want is to sort in a debt-free way from the register no. 769 without registering records from 1 to 768, this may help me to help me. base example to order /* procedimiento para crear bases de datos. data list list /ncuest, var1 to var10. begin data. 1 1 5 150 0 0 0 0 15 20 2 1 3 180 50 35 0 80 0 35 3 0.68 4 350 0 384 35 30 0 80 4 4 5 80 80 0 35 384 200 350 5 0 3 200 0 50 30 0 200 1 6 3 280 25 0 0 50 10 2 3 7 0 35 5 0 10 15 0 5 10 8 7 40 384 66 0 0 0 100 384 9 2 50 35 80 35 340 200 0 1 10 0.15 80 50 0 0 384 100 1 25 11 9 5 5 40 0 0 0 0 311 250 10 2 20 15 384 0 100 200 1 3 8 1 5 150 0 0 0 0 15 20 7 1 3 180 50 35 0 80 0 35 5 0.68 4 350 0 384 35 30 0 80 6 4 5 80 80 0 35 384 200 350 3 0 3 200 0 50 30 0 200 1 2 3 280 25 0 0 50 10 2 3 1 0 35 5 0 10 15 0 5 10 4 7 40 384 66 0 0 0 100 384 5 2 50 35 80 35 340 200 0 1 end data. execute. In my example I want to order from row 11 using the variable ncuest in ascending form without altering the first 10 records. Sincerely, Javier Figueroa Procesamiento y Análisis de bases de datos Cel: 5927-4748 / 4970-1940 Casa: 2289-0184 |
For the example -
RECODE ncuest(1 to 10=1)(else=2) into setnum.
SORT CASES BY setnum, ncuest.
Generally, for the extended problem, you could do
COMMENT 769 and 768 (or 11, 10) are the number of cases involved .
COMPUTE setnum= 769.
IF ($CASENUM le 768) setnum= $CASENUM.
SORT CASES BY setnum, ncuest.
--
Rich Ulrich
From: SPSSX(r) Discussion <[hidden email]> on behalf of Javier Figueroa <[hidden email]>
Sent: Wednesday, September 19, 2018 2:13 PM To: [hidden email] Subject: ORDER DATABASES OF ASCENDING FORM The sea of Maybe is something very simple and that always affects us by our database in an increasing way. Today I come across the databases, both are from the same project, the difference is the period in which the information is accessed, the
first with 768 records and with a variable (initial) ID from 1 to 768 and the second base with 2758 records and also has the variable (ncuest) of ID from 1 to 2758. In the process of cleaning and processing the bases were joined and that's when my problem
happened, at some point the total base was ordered by variable variable in specific, ex. genre and now that I want to go back to how I was I do not achieve
What I want is to sort in a debt-free way from the register no. 769 without registering records from 1 to 768, this may help me to help me.
base example to order
/* procedimiento para crear bases de datos.
data list list
/ncuest, var1 to var10.
begin data.
1 1 5 150 0 0 0 0 15 20
2 1 3 180 50 35 0 80 0 35
3 0.68 4 350 0 384 35 30 0 80
4 4 5 80 80 0 35 384 200 350
5 0 3 200 0 50 30 0 200 1
6 3 280 25 0 0 50 10 2 3
7 0 35 5 0 10 15 0 5 10
8 7 40 384 66 0 0 0 100 384
9 2 50 35 80 35 340 200 0 1
10 0.15 80 50 0 0 384 100 1 25
11
9 5 5 40 0 0 0 0 311 250
10 2 20 15 384 0 100 200 1 3
8 1 5 150 0 0 0 0 15 20
7 1 3 180 50 35 0 80 0 35
5 0.68 4 350 0 384 35 30 0 80
6 4 5 80 80 0 35 384 200 350
3 0 3 200 0 50 30 0 200 1
2 3 280 25 0 0 50 10 2 3
1 0 35 5 0 10 15 0 5 10
4 7 40 384 66 0 0 0 100 384
5 2 50 35 80 35 340 200 0 1
end data.
execute.
In my example I want to order from row 11 using the variable ncuest in ascending form without altering the first 10 records.
Sincerely,
Javier Figueroa
Procesamiento y Análisis de bases de datos Cel: 5927-4748 / 4970-1940
Casa: 2289-0184
|
Thanks! Thank you very much, I work perfectly, I know it would seem very routine but in fact it has taken a lot of time on many occasions, I really appreciate it, a big hug to the entire SPSS community of experts. El mié., 19 sept. 2018 a las 12:49, Rich Ulrich (<[hidden email]>) escribió:
Javier Figueroa Procesamiento y Análisis de bases de datos Cel: 5927-4748 / 4970-1940 Casa: 2289-0184 |
In reply to this post by Javier Figueroa
Another way is to use the IN subcommand on the ADD FILES. That would result in Rich's setnum variable.
ADD FILES / FILE= filespec1/FILE= filespec2/IN=setnum. HTH for the future. ===================== 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 |
Got it, thanks! El mié., 19 sept. 2018 a las 16:29, David Marso (<[hidden email]>) escribió: Another way is to use the IN subcommand on the ADD FILES. That would result in Rich's setnum variable. Javier Figueroa Procesamiento y Análisis de bases de datos Cel: 5927-4748 / 4970-1940 Casa: 2289-0184 |
Free forum by Nabble | Edit this page |