SlideShare a Scribd company logo
1 of 6
Download to read offline
Concatenating String Variables
in IBM SPSS Statistics
What is Concatenating?
 Merging two or more sting variables into a single variable is
called concatenating variables
 This function can be very useful if you are working with string
data in SPSS
 One common use of this function is to bring first name and
last name from two variables into one single full name
variable
2
How to Concatenate?
 String Variables can be concatenated in IBM SPSS Statistics
using the CONCAT function
 The following syntax demonstrates using a compute
command to bring three single name variables together into
a single variable, which combines the three into a full name
variable
3
 The first piece of syntax simply creates a datafile in SPSS to
be worked with -
• DATA LIST
/First_Name 1-4(A) Initial 5-6(A) Last_Name 6-20(A).
BEGIN DATA
Rob E Barry
Ian L O'Connell
Ted W Payne
Rod G Early
Con T Not
Cat P Murphy
Pat C Clifford
Bob A O'Sullivan
END DATA.
CONCAT Function in Syntax
4
 The STRING function below creates a string variable with 64
characters allocated to it-
• STRING Full_Name(A64)
 The CONCAT Function is then used to combine the three
variables ‘First_Name’, ‘Initial’ and ‘Last_Name’
 Notice how CONCAT needs to use the functions ‘rtrim’ and
‘trim’, which remove any blank spaces on the left side (ltrim)
and the right side (rtrim)
• COMPUTE Full_Name =CONCAT(rtrim(ltrim(First_Name)),"
",rtrim(ltrim(Initial))," ",rtrim(ltrim(Last_Name))).
EXEUTE.
CONCAT Function in Syntax
5
www.presidion.com
Talk to us
 info@presidion.com +44 (0)208 757 8820 (UK) +353 (0)1 415 0234 (IRL)
www.presidion.com/ibm-spss-technical-tips
For more Tech Tips
visit

More Related Content

More from Version 1 Analytics

More from Version 1 Analytics (20)

SPSS Statistics - Running a Codebook in IBM SPSS Statistics.pptx
SPSS Statistics - Running a Codebook in IBM SPSS Statistics.pptxSPSS Statistics - Running a Codebook in IBM SPSS Statistics.pptx
SPSS Statistics - Running a Codebook in IBM SPSS Statistics.pptx
 
SPSS Statistics - The ANY function.pptx
SPSS Statistics - The ANY function.pptxSPSS Statistics - The ANY function.pptx
SPSS Statistics - The ANY function.pptx
 
SPSS Statistics - Count Occurances within Cases.pptx
SPSS Statistics - Count Occurances within Cases.pptxSPSS Statistics - Count Occurances within Cases.pptx
SPSS Statistics - Count Occurances within Cases.pptx
 
SPSS Statistics - Customising Toolbars.pptx
SPSS Statistics - Customising Toolbars.pptxSPSS Statistics - Customising Toolbars.pptx
SPSS Statistics - Customising Toolbars.pptx
 
Anonymise Data in IBM SPSS Modeler.pptx
Anonymise Data in IBM SPSS Modeler.pptxAnonymise Data in IBM SPSS Modeler.pptx
Anonymise Data in IBM SPSS Modeler.pptx
 
Disabling Nodes in IBM SPSS Modeler.pptx
Disabling Nodes in IBM SPSS Modeler.pptxDisabling Nodes in IBM SPSS Modeler.pptx
Disabling Nodes in IBM SPSS Modeler.pptx
 
What's This in IBM SPSS Modeler.pptx
What's This in IBM SPSS Modeler.pptxWhat's This in IBM SPSS Modeler.pptx
What's This in IBM SPSS Modeler.pptx
 
Stream Encryption in IBM SPSS Modeler.pptx
Stream Encryption in IBM SPSS Modeler.pptxStream Encryption in IBM SPSS Modeler.pptx
Stream Encryption in IBM SPSS Modeler.pptx
 
Sorting Records in IBM SPSS Modeler.pptx
Sorting Records in IBM SPSS Modeler.pptxSorting Records in IBM SPSS Modeler.pptx
Sorting Records in IBM SPSS Modeler.pptx
 
Setting System Options in IBM SPSS Modeler.pptx
Setting System Options in IBM SPSS Modeler.pptxSetting System Options in IBM SPSS Modeler.pptx
Setting System Options in IBM SPSS Modeler.pptx
 
Sampling Records in IBM SPSS Modeler.pptx
Sampling Records in IBM SPSS Modeler.pptxSampling Records in IBM SPSS Modeler.pptx
Sampling Records in IBM SPSS Modeler.pptx
 
Quickly Audit Data in IBM SPSS Modeler.pptx
Quickly Audit Data in IBM SPSS Modeler.pptxQuickly Audit Data in IBM SPSS Modeler.pptx
Quickly Audit Data in IBM SPSS Modeler.pptx
 
Order Fields in a File in IBM SPSS Modeler.pptx
Order Fields in a File in IBM SPSS Modeler.pptxOrder Fields in a File in IBM SPSS Modeler.pptx
Order Fields in a File in IBM SPSS Modeler.pptx
 
Looking for Relationships in Data in IBM SPSS Modeler.pptx
Looking for Relationships in Data in IBM SPSS Modeler.pptxLooking for Relationships in Data in IBM SPSS Modeler.pptx
Looking for Relationships in Data in IBM SPSS Modeler.pptx
 
Find Duplicate Records in IBM SPSS Modeler.pptx
Find Duplicate Records in IBM SPSS Modeler.pptxFind Duplicate Records in IBM SPSS Modeler.pptx
Find Duplicate Records in IBM SPSS Modeler.pptx
 
Examine Statistics in IBM SPSS Modeler.pptx
Examine Statistics in IBM SPSS Modeler.pptxExamine Statistics in IBM SPSS Modeler.pptx
Examine Statistics in IBM SPSS Modeler.pptx
 
Comparing Means in IBM SPSS Modeler.pptx
Comparing Means in IBM SPSS Modeler.pptxComparing Means in IBM SPSS Modeler.pptx
Comparing Means in IBM SPSS Modeler.pptx
 
Bin Data in IBM SPSS Modeler.pptx
Bin Data in IBM SPSS Modeler.pptxBin Data in IBM SPSS Modeler.pptx
Bin Data in IBM SPSS Modeler.pptx
 
Anonymize Data in IBM SPSS Modeler.pptx
Anonymize Data in IBM SPSS Modeler.pptxAnonymize Data in IBM SPSS Modeler.pptx
Anonymize Data in IBM SPSS Modeler.pptx
 
Annotating Nodes in IBM SPSS Modeler.pptx
Annotating Nodes in IBM SPSS Modeler.pptxAnnotating Nodes in IBM SPSS Modeler.pptx
Annotating Nodes in IBM SPSS Modeler.pptx
 

Recently uploaded

一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理
一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理
一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理
pyhepag
 
Exploratory Data Analysis - Dilip S.pptx
Exploratory Data Analysis - Dilip S.pptxExploratory Data Analysis - Dilip S.pptx
Exploratory Data Analysis - Dilip S.pptx
DilipVasan
 
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Valters Lauzums
 
一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理
cyebo
 
一比一原版西悉尼大学毕业证成绩单如何办理
一比一原版西悉尼大学毕业证成绩单如何办理一比一原版西悉尼大学毕业证成绩单如何办理
一比一原版西悉尼大学毕业证成绩单如何办理
pyhepag
 
Abortion pills in Dammam Saudi Arabia// +966572737505 // buy cytotec
Abortion pills in Dammam Saudi Arabia// +966572737505 // buy cytotecAbortion pills in Dammam Saudi Arabia// +966572737505 // buy cytotec
Abortion pills in Dammam Saudi Arabia// +966572737505 // buy cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Fuzzy Sets decision making under information of uncertainty
Fuzzy Sets decision making under information of uncertaintyFuzzy Sets decision making under information of uncertainty
Fuzzy Sets decision making under information of uncertainty
RafigAliyev2
 
一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理
pyhepag
 

Recently uploaded (20)

Pre-ProductionImproveddsfjgndflghtgg.pptx
Pre-ProductionImproveddsfjgndflghtgg.pptxPre-ProductionImproveddsfjgndflghtgg.pptx
Pre-ProductionImproveddsfjgndflghtgg.pptx
 
一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理
一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理
一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理
 
2024 Q2 Orange County (CA) Tableau User Group Meeting
2024 Q2 Orange County (CA) Tableau User Group Meeting2024 Q2 Orange County (CA) Tableau User Group Meeting
2024 Q2 Orange County (CA) Tableau User Group Meeting
 
Exploratory Data Analysis - Dilip S.pptx
Exploratory Data Analysis - Dilip S.pptxExploratory Data Analysis - Dilip S.pptx
Exploratory Data Analysis - Dilip S.pptx
 
Generative AI for Trailblazers_ Unlock the Future of AI.pdf
Generative AI for Trailblazers_ Unlock the Future of AI.pdfGenerative AI for Trailblazers_ Unlock the Future of AI.pdf
Generative AI for Trailblazers_ Unlock the Future of AI.pdf
 
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
 
AI Imagen for data-storytelling Infographics.pdf
AI Imagen for data-storytelling Infographics.pdfAI Imagen for data-storytelling Infographics.pdf
AI Imagen for data-storytelling Infographics.pdf
 
一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理
 
Slip-and-fall Injuries: Top Workers' Comp Claims
Slip-and-fall Injuries: Top Workers' Comp ClaimsSlip-and-fall Injuries: Top Workers' Comp Claims
Slip-and-fall Injuries: Top Workers' Comp Claims
 
basics of data science with application areas.pdf
basics of data science with application areas.pdfbasics of data science with application areas.pdf
basics of data science with application areas.pdf
 
Machine Learning for Accident Severity Prediction
Machine Learning for Accident Severity PredictionMachine Learning for Accident Severity Prediction
Machine Learning for Accident Severity Prediction
 
2024 Q1 Tableau User Group Leader Quarterly Call
2024 Q1 Tableau User Group Leader Quarterly Call2024 Q1 Tableau User Group Leader Quarterly Call
2024 Q1 Tableau User Group Leader Quarterly Call
 
How I opened a fake bank account and didn't go to prison
How I opened a fake bank account and didn't go to prisonHow I opened a fake bank account and didn't go to prison
How I opened a fake bank account and didn't go to prison
 
Easy and simple project file on mp online
Easy and simple project file on mp onlineEasy and simple project file on mp online
Easy and simple project file on mp online
 
一比一原版西悉尼大学毕业证成绩单如何办理
一比一原版西悉尼大学毕业证成绩单如何办理一比一原版西悉尼大学毕业证成绩单如何办理
一比一原版西悉尼大学毕业证成绩单如何办理
 
Webinar One View, Multiple Systems No-Code Integration of Salesforce and ERPs
Webinar One View, Multiple Systems No-Code Integration of Salesforce and ERPsWebinar One View, Multiple Systems No-Code Integration of Salesforce and ERPs
Webinar One View, Multiple Systems No-Code Integration of Salesforce and ERPs
 
Supply chain analytics to combat the effects of Ukraine-Russia-conflict
Supply chain analytics to combat the effects of Ukraine-Russia-conflictSupply chain analytics to combat the effects of Ukraine-Russia-conflict
Supply chain analytics to combat the effects of Ukraine-Russia-conflict
 
Abortion pills in Dammam Saudi Arabia// +966572737505 // buy cytotec
Abortion pills in Dammam Saudi Arabia// +966572737505 // buy cytotecAbortion pills in Dammam Saudi Arabia// +966572737505 // buy cytotec
Abortion pills in Dammam Saudi Arabia// +966572737505 // buy cytotec
 
Fuzzy Sets decision making under information of uncertainty
Fuzzy Sets decision making under information of uncertaintyFuzzy Sets decision making under information of uncertainty
Fuzzy Sets decision making under information of uncertainty
 
一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理
 

Tech Tip: Concatenating String Variables in IBM SPSS Statistics

  • 1. Concatenating String Variables in IBM SPSS Statistics
  • 2. What is Concatenating?  Merging two or more sting variables into a single variable is called concatenating variables  This function can be very useful if you are working with string data in SPSS  One common use of this function is to bring first name and last name from two variables into one single full name variable 2
  • 3. How to Concatenate?  String Variables can be concatenated in IBM SPSS Statistics using the CONCAT function  The following syntax demonstrates using a compute command to bring three single name variables together into a single variable, which combines the three into a full name variable 3
  • 4.  The first piece of syntax simply creates a datafile in SPSS to be worked with - • DATA LIST /First_Name 1-4(A) Initial 5-6(A) Last_Name 6-20(A). BEGIN DATA Rob E Barry Ian L O'Connell Ted W Payne Rod G Early Con T Not Cat P Murphy Pat C Clifford Bob A O'Sullivan END DATA. CONCAT Function in Syntax 4
  • 5.  The STRING function below creates a string variable with 64 characters allocated to it- • STRING Full_Name(A64)  The CONCAT Function is then used to combine the three variables ‘First_Name’, ‘Initial’ and ‘Last_Name’  Notice how CONCAT needs to use the functions ‘rtrim’ and ‘trim’, which remove any blank spaces on the left side (ltrim) and the right side (rtrim) • COMPUTE Full_Name =CONCAT(rtrim(ltrim(First_Name))," ",rtrim(ltrim(Initial))," ",rtrim(ltrim(Last_Name))). EXEUTE. CONCAT Function in Syntax 5
  • 6. www.presidion.com Talk to us  info@presidion.com +44 (0)208 757 8820 (UK) +353 (0)1 415 0234 (IRL) www.presidion.com/ibm-spss-technical-tips For more Tech Tips visit