def _run_proc(self, procname: str, required_set: set, legal_set: set, **kwargs: dict):
data = kwargs.pop('<STR_LIT:data>', None)<EOL>if isinstance(data, str):<EOL><INDENT>tempdata = data<EOL>try:<EOL><INDENT>table = tempdata.split('<STR_LIT:.>')[-<NUM_LIT:1>]<EOL>lib = tempdata.split('<STR_LIT:.>')[-<NUM_LIT:2>]<EOL><DEDENT>except IndexError:<EOL><INDENT>lib = '<STR_LIT>'<EOL><DEDENT>assert self.sas.exist(table, lib), "<STR_LIT>"<EOL>data = self.sas.sasdata(table, lib)<EOL><DEDENT>assert isinstance(data, SASdata), "<STR_LIT>"<EOL>if required_set is None:<EOL><INDENT>required_set = {}<EOL><DEDENT>objtype = procname.lower()<EOL>if {'<STR_LIT>'}.intersection(required_set) and '<STR_LIT:target>' in kwargs.keys() and '<STR_LIT>' not in kwargs.keys():<EOL><INDENT>kwargs = SASProcCommons._processNominals(self, kwargs, data)<EOL>t_str, tcls_str = SASProcCommons._target_stmt(self, kwargs['<STR_LIT:target>'])<EOL>i_str, icls_str = SASProcCommons._input_stmt(self, kwargs['<STR_LIT:input>'])<EOL>kwargs['<STR_LIT>'] = str(t_str + '<STR_LIT>' + i_str)<EOL>if len(icls_str) > <NUM_LIT:0>:<EOL><INDENT>kwargs['<STR_LIT>'] = str(tcls_str + "<STR_LIT:U+0020>" + icls_str)<EOL><DEDENT>legal_set.add('<STR_LIT>')<EOL>drop_target = kwargs.pop('<STR_LIT:target>', None)<EOL>drop_input = kwargs.pop('<STR_LIT:input>', None)<EOL>self.logger.debug(drop_target)<EOL>self.logger.debug(drop_input)<EOL><DEDENT>elif {'<STR_LIT:target>'}.intersection(required_set) and '<STR_LIT>' in kwargs.keys() and '<STR_LIT:target>' not in kwargs.keys():<EOL><INDENT>SASProcCommons._convert_model_to_target(self)<EOL><DEDENT>verifiedKwargs = SASProcCommons._stmt_check(self, required_set, legal_set, kwargs)<EOL>obj1 = []<EOL>nosub = False<EOL>objname = '<STR_LIT>'<EOL>log = '<STR_LIT>'<EOL>if len(verifiedKwargs):<EOL><INDENT>objname = procname[:<NUM_LIT:3>].lower() + self.sas._objcnt()  <EOL>code = SASProcCommons._makeProcCallMacro(self, objtype, objname, data, verifiedKwargs)<EOL>self.logger.debug(procname + "<STR_LIT>" + str(code))<EOL>if not self.sas.nosub:<EOL><INDENT>ll = self.sas.submit(code, "<STR_LIT:text>")<EOL>log = ll['<STR_LIT>']<EOL>error = SASProcCommons._errorLog(log)<EOL>isinstance(error, str)<EOL>if len(error) > <NUM_LIT:1>:<EOL><INDENT>RuntimeWarning("<STR_LIT>" % error)<EOL>return SASresults(obj1, self.sas, objname, nosub, log)<EOL><DEDENT>try:<EOL><INDENT>obj1 = SASProcCommons._objectmethods(self, objname)<EOL>self.logger.debug(obj1)<EOL><DEDENT>except Exception:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>else:<EOL><INDENT>print(code)<EOL>nosub = True<EOL><DEDENT><DEDENT>else:<EOL><INDENT>RuntimeWarning("<STR_LIT>")<EOL><DEDENT>return SASresults(obj1, self.sas, objname, nosub, log)<EOL>
This internal method takes the options and statements from the PROC and generates
the code needed to submit it to SAS. It then submits the code.
:param self:
:param procname: str
:param required_set: set of options
:param legal_set: set of valid options
:param kwargs: dict (optional)
:return: sas result object