def _dsopts(self, dsopts):
opts = '<STR_LIT>'<EOL>fmat = '<STR_LIT>'<EOL>if len(dsopts):<EOL><INDENT>for key in dsopts:<EOL><INDENT>if len(str(dsopts[key])):<EOL><INDENT>if key == '<STR_LIT>':<EOL><INDENT>if isinstance(dsopts[key], str):<EOL><INDENT>opts += '<STR_LIT>' + dsopts[key] + '<STR_LIT>'<EOL><DEDENT>elif isinstance(dsopts[key], list):<EOL><INDENT>opts += '<STR_LIT>' + "<STR_LIT>".join(dsopts[key]) + '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>".format(key))<EOL><DEDENT><DEDENT>elif key == '<STR_LIT>':<EOL><INDENT>opts += '<STR_LIT>'<EOL>if isinstance(dsopts[key], list):<EOL><INDENT>for var in dsopts[key]:<EOL><INDENT>opts += var + '<STR_LIT:U+0020>'<EOL><DEDENT><DEDENT>else:<EOL><INDENT>opts += dsopts[key] + '<STR_LIT:U+0020>'<EOL><DEDENT><DEDENT>elif key == '<STR_LIT>':<EOL><INDENT>opts += '<STR_LIT>'<EOL>if isinstance(dsopts[key], list):<EOL><INDENT>for var in dsopts[key]:<EOL><INDENT>opts += var + '<STR_LIT:U+0020>'<EOL><DEDENT><DEDENT>else:<EOL><INDENT>opts += dsopts[key] + '<STR_LIT:U+0020>'<EOL><DEDENT><DEDENT>elif key == '<STR_LIT>':<EOL><INDENT>opts += '<STR_LIT>' + str(dsopts[key]) + '<STR_LIT:U+0020>'<EOL><DEDENT>elif key == '<STR_LIT>':<EOL><INDENT>opts += '<STR_LIT>' + str(dsopts[key]) + '<STR_LIT:U+0020>'<EOL><DEDENT>elif key == '<STR_LIT>':<EOL><INDENT>if isinstance(dsopts[key], str):<EOL><INDENT>fmat = '<STR_LIT>' + dsopts[key] + '<STR_LIT:;>'<EOL><DEDENT>elif isinstance(dsopts[key], dict):<EOL><INDENT>fmat = '<STR_LIT>'<EOL>for k, v in dsopts[key].items():<EOL><INDENT>fmat += '<STR_LIT:U+0020>'.join((k, v)) + '<STR_LIT:U+0020>'<EOL><DEDENT>fmat += '<STR_LIT:;>'<EOL><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>".format(key))<EOL><DEDENT><DEDENT><DEDENT><DEDENT>if len(opts):<EOL><INDENT>opts = '<STR_LIT:(>' + opts + '<STR_LIT:)>'<EOL>if len(fmat) > <NUM_LIT:0>:<EOL><INDENT>opts += '<STR_LIT>' + fmat<EOL><DEDENT><DEDENT>elif len(fmat) > <NUM_LIT:0>:<EOL><INDENT>opts = '<STR_LIT>' + fmat<EOL><DEDENT><DEDENT>return opts<EOL>
:param dsopts: a dictionary containing any of the following SAS data set options(where, drop, keep, obs, firstobs):

    - where is a string or list of strings
    - keep are strings or list of strings.
    - drop are strings or list of strings.
    - obs is a numbers - either string or int
    - first obs is a numbers - either string or int
    - format is a string or dictionary { var: format }

    .. code-block:: python

                     {'where'    : 'msrp < 20000 and make = "Ford"'
                      'keep'     : 'msrp enginesize Cylinders Horsepower Weight'
                      'drop'     : ['msrp', 'enginesize', 'Cylinders', 'Horsepower', 'Weight']
                      'obs'      :  10
                      'firstobs' : '12'
                      'format'  : {'money': 'dollar10', 'time': 'tod5.'}
                     }
:return: str