My goal is to copy a dataset from arcsde to a file gdb. I have created a gdb with the name of current date of the system just to maintain the archive of gdbs. I am trying to copy the dataset with specified name and copying that to the newly created gdb. My code is as follows which giving me the error pasted at the bottom:
>>> today=date.today()
>>> d4 = today.strftime("%b_%d_%Y")
>>> arcpy.CreateFileGDB_management("D:\Data",'{}'.format(d4))
>>> outpath = r'D:\Data\{}'.format(d4) + ".gdb"
>>> list=arcpy.ListDatasets()
>>> for b in list:
... if b == 'CONSDATA.NC_COM':
... output = outpath + os.sep + b
... arcpy.CopyFeatures_management(b,output)
Runtime error Traceback (most recent call last): File "<string>", line 4, in <module> File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy\management.py", line 2574, in CopyFeatures raise e ExecuteError: ERROR 000732: Input Features: Dataset CONSDATA.NC_COM does not exist or is not supported.