Okay, now I understand what you are trying to do.
Even though you have it working, you may want to change it to this method, because if you decide to add or remove guys later, things will be much easier.
I pretty much answered your Q already, but you are so stuck on doing things your way, even though it doesn't work, that you can't see that.
But actually now that I see what you are trying to do, the answer is even easier:
Alright, so first off, you make a string with your variable name, like you already have done. In your case, it comes from 2 variables, right? _id1 & _id2 or something like that. Now, that is just a string that is stored in a variable, NOT a variable. BUT, in the createunit command, it will execute a string as though it is a line of code! So, using the format command, we can do exactly what you want.
Basically, you want the "init" field of your unit to look like this:
"
(_id1+_id2) = this"
Only, you want the value of _id1 and _id2 to be in there, because together they make your variable name. So you just need to use the format command like this:
format["%1%2 = this", _id1, _id2]
Then you just plop this into the "init" part of the createunit command like so:
"soldierEB" createUnit [somePos, predefinedGrp, format["%1%2 = this", _id1, _id2]]
For example, if you had _id1 = "guy", and _id2 = "01", then this would be put in the createUnit command, where the "format" stuff is right now:
"guy01 = this"
-----------------------
Now, when you want to reference that guy again, you are going to have to kinda do the same trick. Only there is no "init string" to use. BUT there is the "CALL" command, which will execute a string as if it were a line of code. So, lets say we wanted to use "guy01" in some other script. We could get him into a local variable, just like this:
_id1 = "guy"
_id2 = "01"
_man = null
call format["_man = %1%2", _id1, _id2]
Now "_man" has "guy01" in it. Neat huh?
Anyway, I learned this trick from Dinger over at the CoC, so big thanks to him, because I never would have thought of it myself.