The easiest approach that is portable across all platforms would be:
1 | SET temp_len.ief_supplied.count TO length( trim( temp_input.ief_supplied.command ) )
2 | +=>FOR temp_pos.ief_supplied.count FROM 1 TO temp_len.ief_supplied.count BY 1
3 | | SET temp_byte.ief_supplied.flag TO substr( temp_input.ief_supplied.command , temp_pos.ief_supplied.count , 1 )
4 | | +->IF temp_byte.ief_supplied.flag = "-"
5 | | | SET temp_byte.ief_supplied.flag TO "\"
4 | | +--
6 | | +->IF temp_pos.ief_supplied.count = 1
7 | | | SET temp_output.ief_supplied.command TO temp_byte.ief_supplied.flag
6 | | +> ELSE
8 | | | SET temp_output.ief_supplied.command TO concat( substr( temp_output.ief_supplied.command , 1 , temp_pos.ief_supplied.count - 1 ) , temp_byte.ief_supplied.flag )
6 | | +--
2 | +--
As long as you are not performing this thousands of times, it should be OK, but if performance is a consideration, then an EAB or inline code would be an alternative.
You could also change the code to use a single string rather than a separate input and output but this would require more processing time.