Stata/MP 14.2 and my installation does not have internet access, so I cannot copy code or output to this forum.

The last character of the last column name is dropped when naming the matrix and I have no idea why.

Code:
local variables_sum var1 var2 var3
local variables_avg var4 var5 var6
local variables_max var7 var8

local scalar row_cnt = `:word count `variables_sum' +`:word count `variables_avg' +`:word count `variables_max'

local cols /// // these are not the real strings, just for example here
"String1" ///
"String2" ///
"String3" ///
"String4" ///
"String5" ///
"String6" ///
"String7" ///
"String8" ///
"String9" ///
"String10" ///
"String11" ///
"String12" ///
"String13" ///
"String14" ///
"String15"

local scalar col_cnt = `:word count `cols''

matrix A = J(row_cnt, col_cnt,.)
matrix colnames A = `cols'
I cannot paste the output, but the output has all of the columns named perfectly except the last one, where the name in the matrix appears as "String1" when it should be "String15".

It also randomly adds a ' " ' to one of the column names too, and I have no clue why as I did not change that code at all. This is frustrating, as I export this matrix to Excel and use it with Python, which then throws errors when the names in the matrix are not what they should be. This was working when I had fewer strings in the macro used to name the columns. Why would it all of a sudden not behave the same way?

Anybody know what is going on?