Hi there,
I am working with putdocx and would like to return the first observation of a string value in putdocx text ().
For example, I have a variable, facility, with string values and I would like to return the first observation, "facility a", text in a sentence like below:
"At facility a you will need to conduct xx interviews". I have tried using scalar expressions like "scalar sdp=substr(facility,1,40)" but those seem to only work for numeric or missing values and I cannot return the result in putdocx text.
Is there a way I could do this with the following dataset?
Thanks so much!
I am working with putdocx and would like to return the first observation of a string value in putdocx text ().
For example, I have a variable, facility, with string values and I would like to return the first observation, "facility a", text in a sentence like below:
"At facility a you will need to conduct xx interviews". I have tried using scalar expressions like "scalar sdp=substr(facility,1,40)" but those seem to only work for numeric or missing values and I cannot return the result in putdocx text.
Is there a way I could do this with the following dataset?
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str40 facility "facility a" "facility b" "facility c" end

Comment