*! version 3.0.2  02apr2003  ESH
*! version 3.0.1  26mar2003  ESH
*! version 3.0.0  25mar2003  ESH
*! This command is byable
program define ggen, nclass byable(onecall)
	/* ggen2 [type] newvar = exp [if] [in] */
	version 7
	if _by() {
		local by "by `_byvars', `_byrc0':"
		tokenize `"`0'"', parse(" =")
		local vn `1'
		local equal "`2'"
		capture assert "`equal'" == "="
		if _rc != 0 {
			local vn `2'
		}
		`by' generate `0'
		notes2 "`vn'": `by' ggen `"`0'"'
	}
	else {
		tokenize `"`0'"', parse(" =")
		local vn `1'
		local equal "`2'"
		capture assert "`equal'" == "="
		if _rc != 0 {
			local vn `2'
		}
		generate `0'
		notes2 "`vn'": ggen `"`0'"'
	}
end

exit

change to version 7

change
		note "`vn'": `by' ggen `"`0'"'
to
		notes2 "`vn'": `by' ggen `"`0'"'