I have 6 categorical variables taking on one response per observation. These variables represent fields (maximum of 6) and what crop the farmer grew in each field. What I want is to get what I call crop portfolios by concatenating only unique values of variables cropa_01-cropa_06. In short, I want "concatenate" to ignore the order of answers in the primary variables, and also to ignore repeats. The closest code I came to which is not able to do this is (though it clears the missing as I would want)
Code:
 egen portfoloio = concat(cropa_*), decode
replace portfolio = subinstr(portfolio, ".", "", .)
Here is the example dataset and further explanation below

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input byte(cropa_01 cropa_02 cropa_03 cropa_04 cropa_05 cropa_06)
1  1  .  . . .
1  .  .  . . .
.  1  .  . . .
1  .  6  . . .
.  1  6 12 . .
1  . 12  . . .
1  .  .  . . .
1 12  .  . . .
6  1  .  . . .
.  1 12  . . .
1 12  4  . . .
end
label values cropa_01 CROPA
label values cropa_02 CROPA
label values cropa_03 CROPA
label values cropa_04 CROPA
label values cropa_05 CROPA
label values cropa_06 CROPA
label def CROPA 1 " Maize", modify
label def CROPA 6 " Groundnuts", modify
label def CROPA 12 " Mixed beans", modify
label def CROPA 4 " Millet", modify
In the example dataset above, I would want observation #1 to just be "maize" and not "maize maize" (repeats) and observation #4 (1.6...) and #9 (6 1 ....) to be the same, that is "Maize groundnuts"