I have a terminal script that queries sys.process' and then parses the results writing to a logfile. As part of the processing of the results, each row of the result set includes an element from the static string. But I am not clear on the scoping of the static string. The write statement sees the static string as undefined. What I want is something to the affect:
set statStr = "aa|bb|.."
set sqlStatement = xxx
set tState = ##class(%SQL.Statement).%New()
set qStat = tState.%Prepare(< sql statement> )