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

一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
wsppdmt
 
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
vexqp
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
nirzagarg
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
gajnagarg
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
ranjankumarbehera14
 
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
vexqp
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
ahmedjiabur940
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
nirzagarg
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit RiyadhCytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
Abortion pills in Riyadh +966572737505 get cytotec
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
Health
 

Recently uploaded (20)

Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATIONCapstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATION
 
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
 
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
怎样办理圣路易斯大学毕业证(SLU毕业证书)成绩单学校原版复制
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
 
Data Analyst Tasks to do the internship.pdf
Data Analyst Tasks to do the internship.pdfData Analyst Tasks to do the internship.pdf
Data Analyst Tasks to do the internship.pdf
 
Dubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls DubaiDubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls Dubai
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
 
Harnessing the Power of GenAI for BI and Reporting.pptx
Harnessing the Power of GenAI for BI and Reporting.pptxHarnessing the Power of GenAI for BI and Reporting.pptx
Harnessing the Power of GenAI for BI and Reporting.pptx
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
 
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
 
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit RiyadhCytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
 

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