Isn't there already a pre-built job in SAS DIS that creates such reports?
If you need something different then yes, it is possible to query SAS metadata via code but writing such code gets quickly involved. If the existing DIS report doesn't give you what you need then I'd recommend to spend some time for research/Googling as there is a good chance someone already shared code very close to what you need.