Most of us on the SAS forum have little or no experience with STATA. You may get better help if tell us what that STATA code is supposed to actually do.
As a minimum you might at least list your existing SAS variable names and which are numeric and which are character.