How to use the function in saspy

To help you get started, we’ve selected a few saspy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sassoftware / saspy / saspy / View on Github external

        uoargs = {}
        orderedargs = {}
        keyorder = ['by', 'input', 'target', 'cls', 'model', 'output']
        for k, v in args.items():
            if k in keyorder:
                orderedargs[k] = v
                uoargs[k] = v
        orderedargs = OrderedDict(sorted(orderedargs.items(), key=lambda i: keyorder.index(i[0])))
        for k, v in uoargs.items():
            orderedargs[k] = v
        for key, value in orderedargs.items():
            gen =, value)
            gen.objtype = objtype
   = data
            gen.outmeth = outmeth
            gen.objname = objname
            code += gen.codestmt
            if gen.debug is not None:
                debug_code += gen.debug

        code += "run; quit; %mend;\n"
        code += "%%mangobj(%s,%s,'%s'n);" % (objname, objtype, data.table)
        if self.logger.level == 10:
            print("Proc code submission:\n " + str(code))
            print("\n\n\n" + debug_code)
        return code
github sassoftware / saspy / saspy / View on Github external
outmeth = 'out'
            plot = 'plot=all'
        if self.sasproduct.lower() == 'em':

        if self.sasproduct.lower() == 'vddml':
            outmeth = 'out'
        if self.sasproduct.lower() == 'util':
            outmeth = 'out'
            if objtype.lower() =='univariate' and not ('ODSGraphics' in args.keys() or ODSGraphics == False):
                plot = 'plot'
                outmeth = ''
        outds = args.pop('out', None)
        if outds == None:
            outds = args.pop('output', None)
        outcodegen ='out', outds)
        outcodegen.outmeth = outmeth
        outcodegen.objname = objname
        outstr = outcodegen.codestmt
        self.logger.debug("product caller: " + self.sasproduct.lower())
        debug_code= ''
        code = "%macro proccall(d);\n"
        # resolve issues withe Proc options, out= and plots=
        # The procopts statement should be in every procedure as a way to pass arbitrary options to the procedures
        if 'outmeth' in args:
            outmeth = args['outmeth']
        if 'plot' in args:
            plot = args['plot']
        if len(outmeth) and not outds == None:
            code += "proc %s data=%s.'%s'n %s %s %s=%s %s ;\n" % (
                objtype, data.libref, data.table, data._dsopts(), plot, outmeth, outstr, procopts)