I'm looking for a Stata command that stores the maximum and minimum length of a string variable - as a shortcut to the long way, which would go by:
gen vnew = strlen(v1)
egen smax = max(vnew)
etc.
I want to write syntax that looks like
local smax = r(maxlength)
local smin = r(minlength)
I need these locals as an indicator for correct / incorrect string variables as part of a testing routine of a host of files .
My research of such a command had no result - does someone out there know better?
gen vnew = strlen(v1)
egen smax = max(vnew)
etc.
I want to write syntax that looks like
local smax = r(maxlength)
local smin = r(minlength)
I need these locals as an indicator for correct / incorrect string variables as part of a testing routine of a host of files .
My research of such a command had no result - does someone out there know better?