How do I combine 3 variables (which consist of both letters and numbers) into 1 variable?

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

How do I combine 3 variables (which consist of both letters and numbers) into 1 variable?

stargirl1992
I'm analyzing the results of a study and I'm trying to make a unique ID for
each participant. This unique ID must consist of the information that the
participants already gave me. I have 3 columns named "ID1," "ID2," and
"ID3." For example,for participant #1, under ID1, there is the letter 'T'.
Under ID2, there is the number '22'. Under ID3, there is the number '3'. Now
I need to make a column/variable that now has T223 as a new ID or answer for
this participant. I have to combine ID1, ID2, and ID3 in this manner for all
participants. I have tried to make them all string variables and do Compute
Variable, but I'm unsure whether this is the correct route to go. *Note:
there will be duplicates under each ID column; for example, two 'T''s under
ID1. However, after participant gets their own unique ID, there will not be
any duplicates of the unique ID (or the combination of ID1, ID2, ID3.)

After I get this done, I have to do the same thing for another dataset, and
then merge both datasets together according to this new unique ID for each
participant.

Does anyone have an idea of what to do? I would appreciate the help very
much! Thank you :)



--
Sent from: http://spssx-discussion.1045642.n5.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
Reply | Threaded
Open this post in threaded view
|

Re: How do I combine 3 variables (which consist of both letters and numbers) into 1 variable?

John F Hall

If ID1 is declared as string and the only value is 'T' you could use direct syntax and try something like (untested):

 

RECODE id1 ('T' = 1000) into idx.

COMPUTE idx = idx + id2*10+id3.

 

. .but this will produce idx = 1223 for all cases.  Are you sure this is what you want, or do id2 and 1d3 have more values?

 

Another way of producing a unique id for each case is:

 

COMPUTE id = $seqnum.

. . but to do this with both sets may not match the cases unless there are the same number of cases in the same case order in both files.

 

Can you give more detail using something like:

 

LIST var id1 id2 id3 /cases 20.

or

DESC id1 id2 id3 .

or

FREQ id1 id2 id3 .

 

. . and post the reults to the list?

 

I can give you more help (off-list, and in complete confidence) if you send me a sample of your *sav file(s).

 

John F Hall  MA (Cantab) Dip Ed (Dunelm)

[Retired academic survey researcher]

 

Email:          [hidden email]

Website:     Journeys in Survey Research

Course:       Survey Analysis Workshop (SPSS)

Research:   Subjective Social Indicators (Quality of Life)

 

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of stargirl1992
Sent: 27 February 2018 11:34
To: [hidden email]
Subject: How do I combine 3 variables (which consist of both letters and numbers) into 1 variable?

 

I'm analyzing the results of a study and I'm trying to make a unique ID for each participant. This unique ID must consist of the information that the participants already gave me. I have 3 columns named "ID1," "ID2," and "ID3." For example,for participant #1, under ID1, there is the letter 'T'.

Under ID2, there is the number '22'. Under ID3, there is the number '3'. Now I need to make a column/variable that now has T223 as a new ID or answer for this participant. I have to combine ID1, ID2, and ID3 in this manner for all participants. I have tried to make them all string variables and do Compute Variable, but I'm unsure whether this is the correct route to go. *Note:

there will be duplicates under each ID column; for example, two 'T''s under ID1. However, after participant gets their own unique ID, there will not be any duplicates of the unique ID (or the combination of ID1, ID2, ID3.)

 

After I get this done, I have to do the same thing for another dataset, and then merge both datasets together according to this new unique ID for each participant.

 

Does anyone have an idea of what to do? I would appreciate the help very much! Thank you :)

 

 

 

--

Sent from: http://spssx-discussion.1045642.n5.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
Reply | Threaded
Open this post in threaded view
|

Re: How do I combine 3 variables (which consist of both letters and numbers) into 1 variable?

stargirl1992
Thanks for your reply! However, indeed there is more variety in each column.
I've pasted the first 10 responses.

ID1   ID2   ID3
C 1 2     (for example, this has to turn into C12 in a new column)
er 11 7     (this has to become er117)
I 16 1
B 8 2
T 19 9
V 20 8
M 1 5
G 9 7
N 17 6
H 16 3



--
Sent from: http://spssx-discussion.1045642.n5.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
Reply | Threaded
Open this post in threaded view
|

Re: How do I combine 3 variables (which consist of both letters and numbers) into 1 variable?

David Marso
Administrator
In reply to this post by stargirl1992
Assuming perhaps that the number variables are indeed numeric let's convert
them to STRING.  We then declare a NEW string variable of desired length and
CONCATenate them.

ALTER TYPE ID1 ID2 ID3 (A2).
STRING UniqueID (A8).
COMPUTE UniqueID =CONCAT(!D1,ID2,ID3).
--
Ignore John's advice, it is simply wrong in this case.


stargirl1992 wrote

> I'm analyzing the results of a study and I'm trying to make a unique ID
> for
> each participant. This unique ID must consist of the information that the
> participants already gave me. I have 3 columns named "ID1," "ID2," and
> "ID3." For example,for participant #1, under ID1, there is the letter 'T'.
> Under ID2, there is the number '22'. Under ID3, there is the number '3'.
> Now
> I need to make a column/variable that now has T223 as a new ID or answer
> for
> this participant. I have to combine ID1, ID2, and ID3 in this manner for
> all
> participants. I have tried to make them all string variables and do
> Compute
> Variable, but I'm unsure whether this is the correct route to go. *Note:
> there will be duplicates under each ID column; for example, two 'T''s
> under
> ID1. However, after participant gets their own unique ID, there will not
> be
> any duplicates of the unique ID (or the combination of ID1, ID2, ID3.)
>
> After I get this done, I have to do the same thing for another dataset,
> and
> then merge both datasets together according to this new unique ID for each
> participant.
>
> Does anyone have an idea of what to do? I would appreciate the help very
> much! Thank you :)
>
>
>
> --
> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

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





-----
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?"
--
Sent from: http://spssx-discussion.1045642.n5.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
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?"
Reply | Threaded
Open this post in threaded view
|

Re: How do I combine 3 variables (which consist of both letters and numbers) into 1 variable?

John F Hall
I was only trying to help, but I was right to query the data structure and
content.  Marso right as usual!

John F Hall  MA (Cantab) Dip Ed (Dunelm)
[Retired academic survey researcher]

Email:          [hidden email]
Website:     Journeys in Survey Research
Course:       Survey Analysis Workshop (SPSS)
Research:   Subjective Social Indicators (Quality of Life)

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
David Marso
Sent: 27 February 2018 13:17
To: [hidden email]
Subject: Re: How do I combine 3 variables (which consist of both letters and
numbers) into 1 variable?

Assuming perhaps that the number variables are indeed numeric let's convert
them to STRING.  We then declare a NEW string variable of desired length and
CONCATenate them.

ALTER TYPE ID1 ID2 ID3 (A2).
STRING UniqueID (A8).
COMPUTE UniqueID =CONCAT(!D1,ID2,ID3).
--
Ignore John's advice, it is simply wrong in this case.


stargirl1992 wrote

> I'm analyzing the results of a study and I'm trying to make a unique
> ID for each participant. This unique ID must consist of the
> information that the participants already gave me. I have 3 columns
> named "ID1," "ID2," and "ID3." For example,for participant #1, under
> ID1, there is the letter 'T'.
> Under ID2, there is the number '22'. Under ID3, there is the number '3'.
> Now
> I need to make a column/variable that now has T223 as a new ID or
> answer for this participant. I have to combine ID1, ID2, and ID3 in
> this manner for all participants. I have tried to make them all string
> variables and do Compute Variable, but I'm unsure whether this is the
> correct route to go. *Note:
> there will be duplicates under each ID column; for example, two 'T''s
> under ID1. However, after participant gets their own unique ID, there
> will not be any duplicates of the unique ID (or the combination of
> ID1, ID2, ID3.)
>
> After I get this done, I have to do the same thing for another
> dataset, and then merge both datasets together according to this new
> unique ID for each participant.
>
> Does anyone have an idea of what to do? I would appreciate the help
> very much! Thank you :)
>
>
>
> --
> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

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





-----
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?"
--
Sent from: http://spssx-discussion.1045642.n5.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
Reply | Threaded
Open this post in threaded view
|

Re: How do I combine 3 variables (which consist of both letters and numbers) into 1 variable?

stargirl1992
In reply to this post by David Marso
The code is not working for me. Do you know why? There are some errors...
"Variable STRING specified for ALTER TYPE command line does not exist in the
working data file" but there are variables named ID1, ID2, and ID3.
And for the next 2 command lines, the error is: On the STRING command, the
list of variables being defined was not followed by the formats for those
variables. Execution of this command stops."

I'm very confused. Maybe I should also mention that before I inputted this
code, I had already manually changed the ID1, ID2, and ID3 into string
variables in the Variable View.

The only thing that seems to work is if I just write the syntax: STRING
UniqueID (A8) ... then it makes a new empty variable for me. But when I do
the COMPUTE command, it says the variable has already been defined.



--
Sent from: http://spssx-discussion.1045642.n5.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
Reply | Threaded
Open this post in threaded view
|

Re: How do I combine 3 variables (which consist of both letters and numbers) into 1 variable?

Bruce Weaver
Administrator
In reply to this post by John F Hall
Yes, right again.  But John, I'm surprised you didn't pounce on the
opportunity to note that he obviously intended ID1 where he wrote !D1.   ;-)  



John F Hall wrote
> --- snip ---
> Marso right as usual!
>
> John F Hall  MA (Cantab) Dip Ed (Dunelm)
> [Retired academic survey researcher]
>
> Email:          

> johnfhall@

>  
> Website:     Journeys in Survey Research
> Course:       Survey Analysis Workshop (SPSS)
> Research:   Subjective Social Indicators (Quality of Life)
>
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:

> SPSSX-L@.UGA

> ] On Behalf Of
> David Marso
> Sent: 27 February 2018 13:17
> To:

> SPSSX-L@.UGA

> Subject: Re: How do I combine 3 variables (which consist of both letters
> and
> numbers) into 1 variable?
>
> Assuming perhaps that the number variables are indeed numeric let's
> convert
> them to STRING.  We then declare a NEW string variable of desired length
> and
> CONCATenate them.
>
> ALTER TYPE ID1 ID2 ID3 (A2).
> STRING UniqueID (A8).
> COMPUTE UniqueID =CONCAT(!D1,ID2,ID3).
> --
> Ignore John's advice, it is simply wrong in this case.
>
>
> stargirl1992 wrote
>> I'm analyzing the results of a study and I'm trying to make a unique
>> ID for each participant. This unique ID must consist of the
>> information that the participants already gave me. I have 3 columns
>> named "ID1," "ID2," and "ID3." For example,for participant #1, under
>> ID1, there is the letter 'T'.
>> Under ID2, there is the number '22'. Under ID3, there is the number '3'.
>> Now
>> I need to make a column/variable that now has T223 as a new ID or
>> answer for this participant. I have to combine ID1, ID2, and ID3 in
>> this manner for all participants. I have tried to make them all string
>> variables and do Compute Variable, but I'm unsure whether this is the
>> correct route to go. *Note:
>> there will be duplicates under each ID column; for example, two 'T''s
>> under ID1. However, after participant gets their own unique ID, there
>> will not be any duplicates of the unique ID (or the combination of
>> ID1, ID2, ID3.)
>>
>> After I get this done, I have to do the same thing for another
>> dataset, and then merge both datasets together according to this new
>> unique ID for each participant.
>>
>> Does anyone have an idea of what to do? I would appreciate the help
>> very much! Thank you :)
>>
>>
>>
>> --
>> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>
>> LISTSERV@.UGA
>
>>  (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
>
>
>
>
>
> -----
> 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?"
> --
> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

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

> LISTSERV@.UGA

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





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.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
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.
Reply | Threaded
Open this post in threaded view
|

Re: How do I combine 3 variables (which consist of both letters and numbers) into 1 variable?

Robert L
In reply to this post by stargirl1992
Not sure about the error message, but instead of ALTER TYPE for all ID variables, I would have kept any numeric format for ID2 and ID3 and used the following:

STRING UniqueID(A8).
COMPUTE UniqueID=CONCAT(RTRIM(ID1),STRING(ID2,N2),STRING(ID3,F1)).

Here I have used your example:

DATA LIST LIST/ ID1(A2)  ID2(F2)   ID3(F1).
BEGIN DATA
C 1 2
er 11 7
I 16 1
B 8 2
T 19 9
V 20 8
M 1 5
G 9 7
N 17 6
H 16 3
END DATA.

/Robert

-----Ursprungligt meddelande-----
Från: SPSSX(r) Discussion [mailto:[hidden email]] För stargirl1992
Skickat: den 27 februari 2018 14:29
Till: [hidden email]
Ämne: Re: How do I combine 3 variables (which consist of both letters and numbers) into 1 variable?

The code is not working for me. Do you know why? There are some errors...
"Variable STRING specified for ALTER TYPE command line does not exist in the working data file" but there are variables named ID1, ID2, and ID3.
And for the next 2 command lines, the error is: On the STRING command, the list of variables being defined was not followed by the formats for those variables. Execution of this command stops."

I'm very confused. Maybe I should also mention that before I inputted this code, I had already manually changed the ID1, ID2, and ID3 into string variables in the Variable View.

The only thing that seems to work is if I just write the syntax: STRING UniqueID (A8) ... then it makes a new empty variable for me. But when I do the COMPUTE command, it says the variable has already been defined.



--
Sent from: http://spssx-discussion.1045642.n5.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
Robert Lundqvist
Reply | Threaded
Open this post in threaded view
|

Re: How do I combine 3 variables (which consist of both letters and numbers) into 1 variable?

David Marso
Administrator
In reply to this post by stargirl1992
It is definitely a good thing to post the EXACT code you run and any error
messages.
This works.  I corrected the mistyped !D1 which should have been ID1.
Good catch Bruce.
--
DATA LIST LIST / ID1   ID2   ID3  (3A2).
BEGIN DATA
C 1 2     (for example, this has to turn into C12 in a new column)
er 11 7     (this has to become er117)
I 16 1
B 8 2
T 19 9
V 20 8
M 1 5
G 9 7
N 17 6
H 16 3
END DATA.
ALTER TYPE ID1 ID2 ID3 (A2).
STRING UniqueID (A8).
COMPUTE UniqueID =CONCAT(ID1,ID2,ID3).
LIST.
 
ID1 ID2 ID3 UniqueID
 
C   1   2   C12
er  11  7   er117
I   16  1   I161
B   8   2   B82
T   19  9   T199
V   20  8   V208
M   1   5   M15
G   9   7   G97
N   17  6   N176
H   16  3   H163
 
 
Number of cases read:  10    Number of cases listed:  10


stargirl1992 wrote

> The code is not working for me. Do you know why? There are some errors...
> "Variable STRING specified for ALTER TYPE command line does not exist in
> the
> working data file" but there are variables named ID1, ID2, and ID3.
> And for the next 2 command lines, the error is: On the STRING command, the
> list of variables being defined was not followed by the formats for those
> variables. Execution of this command stops."
>
> I'm very confused. Maybe I should also mention that before I inputted this
> code, I had already manually changed the ID1, ID2, and ID3 into string
> variables in the Variable View.
>
> The only thing that seems to work is if I just write the syntax: STRING
> UniqueID (A8) ... then it makes a new empty variable for me. But when I do
> the COMPUTE command, it says the variable has already been defined.
>
>
>
> --
> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

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





-----
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?"
--
Sent from: http://spssx-discussion.1045642.n5.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
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?"
Reply | Threaded
Open this post in threaded view
|

Re: How do I combine 3 variables (which consist of both letters and numbers) into 1 variable?

Bruce Weaver
Administrator
This post was updated on .
David, given your track record in this forum, my first thought upon seeing
that !D1 was, "Where's the macro definition?"  




David Marso wrote
> It is definitely a good thing to post the EXACT code you run and any error
> messages.
> This works.  I corrected the mistyped !D1 which should have been ID1.
> Good catch Bruce.
> --
> DATA LIST LIST / ID1   ID2   ID3  (3A2).
> BEGIN DATA
> C 1 2     (for example, this has to turn into C12 in a new column)
> er 11 7     (this has to become er117)
> I 16 1
> B 8 2
> T 19 9
> V 20 8
> M 1 5
> G 9 7
> N 17 6
> H 16 3
> END DATA.
> ALTER TYPE ID1 ID2 ID3 (A2).
> STRING UniqueID (A8).
> COMPUTE UniqueID =CONCAT(ID1,ID2,ID3).
> LIST.
>  
> ID1 ID2 ID3 UniqueID
>  
> C   1   2   C12
> er  11  7   er117
> I   16  1   I161
> B   8   2   B82
> T   19  9   T199
> V   20  8   V208
> M   1   5   M15
> G   9   7   G97
> N   17  6   N176
> H   16  3   H163
>  
>  
> Number of cases read:  10    Number of cases listed:  10
>
>
> stargirl1992 wrote
>> The code is not working for me. Do you know why? There are some errors...
>> "Variable STRING specified for ALTER TYPE command line does not exist in
>> the
>> working data file" but there are variables named ID1, ID2, and ID3.
>> And for the next 2 command lines, the error is: On the STRING command,
>> the
>> list of variables being defined was not followed by the formats for those
>> variables. Execution of this command stops."
>>
>> I'm very confused. Maybe I should also mention that before I inputted
>> this
>> code, I had already manually changed the ID1, ID2, and ID3 into string
>> variables in the Variable View.
>>
>> The only thing that seems to work is if I just write the syntax: STRING
>> UniqueID (A8) ... then it makes a new empty variable for me. But when I
>> do
>> the COMPUTE command, it says the variable has already been defined.
>>
>>
>>
>> --
>> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>
>> LISTSERV@.UGA
>
>>  (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
>
>
>
>
>
> -----
> 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?"
> --
> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

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





-----
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (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
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.
Reply | Threaded
Open this post in threaded view
|

Re: How do I combine 3 variables (which consist of both letters and numbers) into 1 variable?

David Marso-2
In reply to this post by stargirl1992
Nah, I just threw that out to see if anybody was paying attention.

=====================
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: How do I combine 3 variables (which consist of both letters and numbers) into 1 variable?

Ki Park
:o) The power of !
It made the day for me with good laugh.
Thank you.
Ki



--
Sent from: http://spssx-discussion.1045642.n5.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
Reply | Threaded
Open this post in threaded view
|

Re: How do I combine 3 variables (which consist of both letters and numbers) into 1 variable?

PRogman
In reply to this post by stargirl1992
I assume you do not have any conflicts in the  ranges of ID2 and ID3: No
confusion like C 1 12 and C 11 2?
Will you sort the data on the concatenated value? C 2 1 will end up after C
11 2.
/PR




--
Sent from: http://spssx-discussion.1045642.n5.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
Reply | Threaded
Open this post in threaded view
|

Re: How do I combine 3 variables (which consist of both letters and numbers) into 1 variable?

David Marso
Administrator
-----
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?"
--
Sent from: http://spssx-discussion.1045642.n5.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
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?"
Reply | Threaded
Open this post in threaded view
|

Re: How do I combine 3 variables (which consist of both letters and numbers) into 1 variable?

David Marso
Administrator
In reply to this post by PRogman
I suggest fixing the numerics to have leading zeroes using N format. That
should eliminate the potential conflict.



PRogman wrote

> I assume you do not have any conflicts in the  ranges of ID2 and ID3: No
> confusion like C 1 12 and C 11 2?
> Will you sort the data on the concatenated value? C 2 1 will end up after
> C
> 11 2.
> /PR
>
>
>
>
> --
> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

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





-----
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?"
--
Sent from: http://spssx-discussion.1045642.n5.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
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?"