How to change small letter to capital letter

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

How to change small letter to capital letter

Khaing Soe-2
Dear All,
 
Much appreciate if I can be guided on this:
 
I am dealing with a dataset where the entries for the  household ID was put in 'string variable like
1hml002
1hml003
1hml004
..........
Is there any possible way to convert the case of  <- hml---> from Small letter to Capital letter without manually doing on every entry- for 3000 entries?
 
Thanking,
Khaing Soe

Reply | Threaded
Open this post in threaded view
|

Re: How to change small letter to capital letter

Bruce Weaver
Administrator
Khaing Soe-2 wrote
Dear All,

Much appreciate if I can be guided on this:

I am dealing with a dataset where the entries for the  household ID was put in
'string variable like

1hml002
1hml003
1hml004
..........
Is there any possible way to convert the case of  <- hml---> from Small
letter to Capital letter without manually doing on every entry- for 3000
entries?

Thanking,
Khaing Soe
Does the string "hml" always appear?  If other letter strings appear, do you want to convert them to uppercase too?  To convert ALL letters to uppercase:

compute householdID = UPCASE(householdID).

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

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: How to change small letter to capital letter

Art Kendall
In reply to this post by Khaing Soe-2
something like this should do it.

string newID(a7).
compute newid = upcase(oldid).

Art Kendall
Social Research Consultants

On 9/23/2010 5:57 AM, Khaing Soe wrote:
Dear All,
 
Much appreciate if I can be guided on this:
 
I am dealing with a dataset where the entries for the  household ID was put in 'string variable like
1hml002
1hml003
1hml004
..........
Is there any possible way to convert the case of  <- hml---> from Small letter to Capital letter without manually doing on every entry- for 3000 entries?
 
Thanking,
Khaing Soe

===================== 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
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: How to change small letter to capital letter

John F Hall
In reply to this post by Khaing Soe-2
Forget it.  SPSS is case insensitive, so it doesn't matter whether variable names are in upprer or lower case , or even mixed.
 
----- Original Message -----
Sent: Thursday, September 23, 2010 11:57 AM
Subject: How to change small letter to capital letter

Dear All,
 
Much appreciate if I can be guided on this:
 
I am dealing with a dataset where the entries for the  household ID was put in 'string variable like
1hml002
1hml003
1hml004
..........
Is there any possible way to convert the case of  <- hml---> from Small letter to Capital letter without manually doing on every entry- for 3000 entries?
 
Thanking,
Khaing Soe

Reply | Threaded
Open this post in threaded view
|

Re: How to change small letter to capital letter

ViAnn Beadle

The OP is asking about values, not variable names. Variable names are case insensitive when parsed in syntax but retain their case when displayed in output.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of John F Hall
Sent: Thursday, September 23, 2010 6:04 AM
To: [hidden email]
Subject: Re: How to change small letter to capital letter

 

Forget it.  SPSS is case insensitive, so it doesn't matter whether variable names are in upprer or lower case , or even mixed.

 

----- Original Message -----

Sent: Thursday, September 23, 2010 11:57 AM

Subject: How to change small letter to capital letter

 

Dear All,

 

Much appreciate if I can be guided on this:

 

I am dealing with a dataset where the entries for the  household ID was put in 'string variable like

1hml002

1hml003

1hml004

..........

Is there any possible way to convert the case of  <- hml---> from Small letter to Capital letter without manually doing on every entry- for 3000 entries?

 

Thanking,

Khaing Soe

 

Reply | Threaded
Open this post in threaded view
|

Re: How to change small letter to capital letter

Khaing Soe-2
Dear All,
My intention is to match two data sets  for which the household ID number is the only key variable . In one data set,   HH ID numbers are small letter like 1hml0001  while these are in capital letter like 1HML0001 in other data set.   I cannot match two data sets.with this. whereas, when I manually changed some values to capital letter, the match was OK. But there are over 3000 cases!
 
Please advise.
 
Regards,
Khaing Soe


From: ViAnn Beadle <[hidden email]>
To: [hidden email]
Sent: Thu, September 23, 2010 7:38:39 PM
Subject: Re: How to change small letter to capital letter

The OP is asking about values, not variable names. Variable names are case insensitive when parsed in syntax but retain their case when displayed in output.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of John F Hall
Sent: Thursday, September 23, 2010 6:04 AM
To: [hidden email]
Subject: Re: How to change small letter to capital letter

 

Forget it.  SPSS is case insensitive, so it doesn't matter whether variable names are in upprer or lower case , or even mixed.

 

John Hall
[hidden email]
http://surveyresearch.weebly.com

----- Original Message -----

Sent: Thursday, September 23, 2010 11:57 AM

Subject: How to change small letter to capital letter

 

Dear All,

 

Much appreciate if I can be guided on this:

 

I am dealing with a dataset where the entries for the  household ID was put in 'string variable like

1hml002

1hml003

1hml004

..........

Is there any possible way to convert the case of  <- hml---> from Small letter to Capital letter without manually doing on every entry- for 3000 entries?

 

Thanking,

Khaing Soe

 


Reply | Threaded
Open this post in threaded view
|

Re: How to change small letter to capital letter [needs a string split and case change]

John F Hall
Just an idea, but you could try downloading the ID column from the data editor to Word, then in Word highlight the whole column and use Format > Change case  and copy it back, but I've been trying this sort of thing with something else and SPSS only copies the first cell, not the whole column.  It might work via Excel and you might also need to change the names by adding a character: that way you can check that the names are the same for the ID bit.
 
I've copied this to others on the list who helped with a similar problem and who may be able to propose syntax for a string operation.
 
 
 
----- Original Message -----
Sent: Friday, September 24, 2010 8:49 AM
Subject: Re: How to change small letter to capital letter

Dear All,
My intention is to match two data sets  for which the household ID number is the only key variable . In one data set,   HH ID numbers are small letter like 1hml0001  while these are in capital letter like 1HML0001 in other data set.   I cannot match two data sets.with this. whereas, when I manually changed some values to capital letter, the match was OK. But there are over 3000 cases!
 
Please advise.
 
Regards,
Khaing Soe


From: ViAnn Beadle <[hidden email]>
To: [hidden email]
Sent: Thu, September 23, 2010 7:38:39 PM
Subject: Re: How to change small letter to capital letter

The OP is asking about values, not variable names. Variable names are case insensitive when parsed in syntax but retain their case when displayed in output.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of John F Hall
Sent: Thursday, September 23, 2010 6:04 AM
To: [hidden email]
Subject: Re: How to change small letter to capital letter

 

Forget it.  SPSS is case insensitive, so it doesn't matter whether variable names are in upprer or lower case , or even mixed.

 

John Hall
[hidden email]
http://surveyresearch.weebly.com

----- Original Message -----

Sent: Thursday, September 23, 2010 11:57 AM

Subject: How to change small letter to capital letter

 

Dear All,

 

Much appreciate if I can be guided on this:

 

I am dealing with a dataset where the entries for the  household ID was put in 'string variable like

1hml002

1hml003

1hml004

..........

Is there any possible way to convert the case of  <- hml---> from Small letter to Capital letter without manually doing on every entry- for 3000 entries?

 

Thanking,

Khaing Soe

 


Reply | Threaded
Open this post in threaded view
|

Re: How to change small letter to capital letter [needs a string split and case change]

Uwe Warner-2

Also just an idea, first sort both files by the HHID, second autorecode on both files the HHID into a numeric ID, third match the files by ID.

Uwe

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of John F Hall
Sent: Freitag, 24. September 2010 10:22
To: [hidden email]
Subject: Re: How to change small letter to capital letter [needs a string split and case change]

 

Just an idea, but you could try downloading the ID column from the data editor to Word, then in Word highlight the whole column and use Format > Change case  and copy it back, but I've been trying this sort of thing with something else and SPSS only copies the first cell, not the whole column.  It might work via Excel and you might also need to change the names by adding a character: that way you can check that the names are the same for the ID bit.

 

I've copied this to others on the list who helped with a similar problem and who may be able to propose syntax for a string operation.

 

 

 

----- Original Message -----

Sent: Friday, September 24, 2010 8:49 AM

Subject: Re: How to change small letter to capital letter

 

Dear All,

My intention is to match two data sets  for which the household ID number is the only key variable . In one data set,   HH ID numbers are small letter like 1hml0001  while these are in capital letter like 1HML0001 in other data set.   I cannot match two data sets.with this. whereas, when I manually changed some values to capital letter, the match was OK. But there are over 3000 cases!

 

Please advise.

 

Regards,

Khaing Soe

 


From: ViAnn Beadle <[hidden email]>
To: [hidden email]
Sent: Thu, September 23, 2010 7:38:39 PM
Subject: Re: How to change small letter to capital letter


The OP is asking about values, not variable names. Variable names are case insensitive when parsed in syntax but retain their case when displayed in output.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of John F Hall
Sent: Thursday, September 23, 2010 6:04 AM
To: [hidden email]
Subject: Re: How to change small letter to capital letter

 

Forget it.  SPSS is case insensitive, so it doesn't matter whether variable names are in upprer or lower case , or even mixed.

 

John Hall
[hidden email]
http://surveyresearch.weebly.com

----- Original Message -----

Sent: Thursday, September 23, 2010 11:57 AM

Subject: How to change small letter to capital letter

 

Dear All,

 

Much appreciate if I can be guided on this:

 

I am dealing with a dataset where the entries for the  household ID was put in 'string variable like

1hml002

1hml003

1hml004

..........

Is there any possible way to convert the case of  <- hml---> from Small letter to Capital letter without manually doing on every entry- for 3000 entries?

 

Thanking,

Khaing Soe

 

 

Reply | Threaded
Open this post in threaded view
|

Re: How to change small letter to capital letter

Art Kendall
In reply to this post by Khaing Soe-2
didn't this work? If not what happened?

string newID(a7).
compute newid = upcase(oldid).

    Art Kendall
    Social Research Consultants


On 9/24/2010 2:49 AM, Khaing Soe wrote:
Dear All,
My intention is to match two data sets  for which the household ID number is the only key variable . In one data set,   HH ID numbers are small letter like 1hml0001  while these are in capital letter like 1HML0001 in other data set.   I cannot match two data sets.with this. whereas, when I manually changed some values to capital letter, the match was OK. But there are over 3000 cases!
 
Please advise.
 
Regards,
Khaing Soe


From: ViAnn Beadle [hidden email]
To: [hidden email]
Sent: Thu, September 23, 2010 7:38:39 PM
Subject: Re: How to change small letter to capital letter

The OP is asking about values, not variable names. Variable names are case insensitive when parsed in syntax but retain their case when displayed in output.

 

From: SPSSX(r) Discussion [[hidden email]] On Behalf Of John F Hall
Sent: Thursday, September 23, 2010 6:04 AM
To: [hidden email]
Subject: Re: How to change small letter to capital letter

 

Forget it.  SPSS is case insensitive, so it doesn't matter whether variable names are in upprer or lower case , or even mixed.

 

----- Original Message -----

Sent: Thursday, September 23, 2010 11:57 AM

Subject: How to change small letter to capital letter

 

Dear All,

 

Much appreciate if I can be guided on this:

 

I am dealing with a dataset where the entries for the  household ID was put in 'string variable like

1hml002

1hml003

1hml004

..........

Is there any possible way to convert the case of  <- hml---> from Small letter to Capital letter without manually doing on every entry- for 3000 entries?

 

Thanking,

Khaing Soe

 


===================== 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
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: How to change small letter to capital letter

Maguin, Eugene
In reply to this post by Khaing Soe-2
Khaing Soe,
 
I think you got replies from several folks (Bruce, Art, and others) and I think their advice to you was something like this
 
compute HHID=upcase(HHID).
 
Did that work? If not, what went wrong?  Please be very specific by posting syntax and any error messages or the description of the cases on which it failed.
 
Gene Maguin
 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Khaing Soe
Sent: Friday, September 24, 2010 2:49 AM
To: [hidden email]
Subject: Re: How to change small letter to capital letter

Dear All,
My intention is to match two data sets  for which the household ID number is the only key variable . In one data set,   HH ID numbers are small letter like 1hml0001  while these are in capital letter like 1HML0001 in other data set.   I cannot match two data sets.with this. whereas, when I manually changed some values to capital letter, the match was OK. But there are over 3000 cases!
 
Please advise.
 
Regards,
Khaing Soe


From: ViAnn Beadle <[hidden email]>
To: [hidden email]
Sent: Thu, September 23, 2010 7:38:39 PM
Subject: Re: How to change small letter to capital letter

The OP is asking about values, not variable names. Variable names are case insensitive when parsed in syntax but retain their case when displayed in output.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of John F Hall
Sent: Thursday, September 23, 2010 6:04 AM
To: [hidden email]
Subject: Re: How to change small letter to capital letter

 

Forget it.  SPSS is case insensitive, so it doesn't matter whether variable names are in upprer or lower case , or even mixed.

 

John Hall
[hidden email]
http://surveyresearch.weebly.com

----- Original Message -----

Sent: Thursday, September 23, 2010 11:57 AM

Subject: How to change small letter to capital letter

 

Dear All,

 

Much appreciate if I can be guided on this:

 

I am dealing with a dataset where the entries for the  household ID was put in 'string variable like

1hml002

1hml003

1hml004

..........

Is there any possible way to convert the case of  <- hml---> from Small letter to Capital letter without manually doing on every entry- for 3000 entries?

 

Thanking,

Khaing Soe

 


Reply | Threaded
Open this post in threaded view
|

Re: How to change small letter to capital letter

Khaing Soe-2
Dear Gene and All,
Apology for late response as I was travelling and internet access is not good in  the countryside of Myanmar.
compute HHID=upcase(HHID) worked, but copying the column to word or excel and re-pasting in SPSS didnt work..
Thanks for all suggestions.
Regards, Khaing Soe

From: Gene Maguin <[hidden email]>
To: [hidden email]
Sent: Fri, September 24, 2010 7:24:08 PM
Subject: Re: How to change small letter to capital letter

Khaing Soe,
 
I think you got replies from several folks (Bruce, Art, and others) and I think their advice to you was something like this
 
compute HHID=upcase(HHID).
 
Did that work? If not, what went wrong?  Please be very specific by posting syntax and any error messages or the description of the cases on which it failed.
 
Gene Maguin
 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Khaing Soe
Sent: Friday, September 24, 2010 2:49 AM
To: [hidden email]
Subject: Re: How to change small letter to capital letter

Dear All,
My intention is to match two data sets  for which the household ID number is the only key variable . In one data set,   HH ID numbers are small letter like 1hml0001  while these are in capital letter like 1HML0001 in other data set.   I cannot match two data sets.with this. whereas, when I manually changed some values to capital letter, the match was OK. But there are over 3000 cases!
 
Please advise.
 
Regards,
Khaing Soe


From: ViAnn Beadle <[hidden email]>
To: [hidden email]
Sent: Thu, September 23, 2010 7:38:39 PM
Subject: Re: How to change small letter to capital letter

The OP is asking about values, not variable names. Variable names are case insensitive when parsed in syntax but retain their case when displayed in output.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of John F Hall
Sent: Thursday, September 23, 2010 6:04 AM
To: [hidden email]
Subject: Re: How to change small letter to capital letter

 

Forget it.  SPSS is case insensitive, so it doesn't matter whether variable names are in upprer or lower case , or even mixed.

 

John Hall
[hidden email]
http://surveyresearch.weebly.com

----- Original Message -----

Sent: Thursday, September 23, 2010 11:57 AM

Subject: How to change small letter to capital letter

 

Dear All,

 

Much appreciate if I can be guided on this:

 

I am dealing with a dataset where the entries for the  household ID was put in 'string variable like

1hml002

1hml003

1hml004

..........

Is there any possible way to convert the case of  <- hml---> from Small letter to Capital letter without manually doing on every entry- for 3000 entries?

 

Thanking,

Khaing Soe