Hello,

I can get dataex to work when all I need to do is get state to make a list of values, but I can't make dataex work when I'm trying to export lines of code.

If I put dataex in the same line as my code, I'm told 'variable not found'.
If I put dataex in a line above my code, I'm told 'input statement exceeds linesize limit. Try specifying fewer variables'. See screenshot below: Array



This is the code I would like to export using dataex:
gen occsoc_noX = subinstr(occsoc, "X", "0", .)
destring occsoc_noX, gen (occsoc_num)

drop occsoc_noX
gen occsoc_noblanks = occsoc
replace occsoc_noblanks = strtrim(occsoc_noblanks)
gen occsoc_noX = subinstr(occsoc_noblanks, "X", "0", .)
destring occsoc_noX, gen (occsoc_num)
What should I do? Have I perhaps misunderstood the function of the command 'dataex'?

Thanks for your time and consideration.

Rosa