Tell me if this is what you want. I'm not sure based on the description.
data list free /variable (A6).
begin data.
ABADEA
end data.
vector v(6).
loop #i=1 to 6.
compute v(#i)=0.
if char.substr(variable,#i,1)="A" v(#i)=1.
end loop.
execute.
list.
Here I obviously made up data simply for the sake of having a string to work with. You wouldn't need the DATA LIST part. The point is that you create a VECTOR of new variables and code them equal to 1 based on the values of the string variable that you want to be some numeric value. That requires looping through each position of the string variable, as I have done here.
------------------------------
Rick Marcantonio
Quality Assurance
IBM
------------------------------
Original Message:
Sent: Fri May 14, 2021 06:49 AM
From: Bervelin Lumesa
Subject: Detectiing a letter from a string variable
Hello dear users.
I have a string variable containing responses from a multiresponse variable, with values such as "ABCE". I would like to create yes/no variables from that. For instance, the first new variable would be 1 if the the old contains "A" and 0 if not.
Which function can be used ?
------------------------------
Bervelin Lumesa
------------------------------
#SPSSStatistics