Chris Hemedinger’s new book Custom Tasks for SAS® Enterprise Guide® Using Microsoft .NET was recently released. If you have an idea for a really useful additional task you’d like to build for SAS Enterprise Guide, I strongly encourage you to read this book and find out how. I certainly got alot out of reading it and learning from Chris’ knowledge and experience.
I think I first spotted this book title about a year ago on SAS Publishing’s Upcoming Titles page. Since then I had been eagerly anticipating its release, so when it became available I was very keen to read it. I even got to provide a review for it too. You can read my review, along with several others, on the book’s reviews page.
One of the things I mentioned in my review was my desire to write a custom task to query SAS metadata from within SAS Enterprise Guide. After finishing the book, going through it a second time to pick up the bits I missed first time around :) , I then busily set about my .. hmm .. well .. ‘task’ …
…. and then sometime later I had a working ‘Metadata Column Finder‘ task. Here’s a screenshot of it in action:
This Metadata Column Finder custom task provides a search facility to help answer the question of “In which columns, in which tables, in which libraries, and in which SAS folders might I find the data I’m looking for?“. You type in a keyword or phrase relating to the item you’re looking for. It then scans the names and descriptions of all the columns defined in metadata and displays the resulting information about those columns, including the tables and libraries in which they can be found. Since it searches metadata, rather than the dictionary tables, it can also find table columns in libraries which have not yet been assigned (as long as your effective metadata permissions also grant you the ability to find them).
Having read Chris’ book, and worked on this, my first task, I’m now even more excited about the possibilities for developing further custom tasks. I’ve already come up with a few more ideas I’d like to try out.
If you’re a keen applications developer, maybe even an ex SAS/AF programmer looking for a new challenge, I’d definitely recommend buying Chris’ new book. As I mentioned in my review I think it’ll save you a ton of time.
I’d like to thank Chris and his new book for helping me get started in this exciting area.
Paul, thanks for the review and for giving the book a good test drive! Your custom task looks really useful. It’s very gratifying to see you and others put the information and technology to good use! I look forward to seeing more inventions from you…
Let me second that. Chris is a wealth of knowledge in this area and I really enjoyed the book. What was a nice treat was also hearing from a production developer on utilities and tools they use for debugging and coding aids. I was not expecting that and pulled out some real gems.
Chris … No problem, it’s a great book and really helpful. I’ll be sure to let you know about the next task.
Alan … I know what you mean, it’s nice to also pick up some broader help on the development process and tools too.
Thanks for your feedback guys.
Hats off ! I don’t want you to open in public your personal cookbook, but how do you manage to launch the Metadata request with SAS EG ? In other words, which API(s) are involved ?
1. EG Custom Task .NET API (Ok)
then …
2.a) workspace session + OMI using PROC METADATA (?)
or
2.b) JAVA Metadata Interface via Java code (?)
or
2.c) other .NET Metadata interface (?)
I thought there were some kind of .NET interface to metadata back in 9.1 which was later deprecated when 9.2 was released (this is not clear ; I might be confused with SAS OLAP Viewer for .NET ).
Thanks Ronan. It was 1 + 2.c. I guess you could also do 2.a but I prefer to go direct to the metadata server.
You have access to the IOMI from .NET (there’s documentation in the .chm help files in a SAS Integration Technologies Client install). IOMI is the well documented, lower level, XML oriented interface to metadata. Whilst there is a higher level (also well documented) Java object model interface layered over the top of IOMI, I’m not aware of an equivalent .NET metadata object model. There might be one, but I don’t know of it, and I couldn’t find any documentation for it on the support.sas.com site (I can only find the documentation for the IOMI XML and Java object interfaces).
Nevertheless, the IOMI interface is all you really need, it just means you have to do your own XML parsing and object factory work. I’ve sometimes needed to do this when using the Java API anyway.
As it happens, I wrote a basic demo of IOMI access from .NET at https://github.com/paulhomes/DotNetOMIDemo
That demo only does very basic metadata queries. The metadata work in the column finder custom task is much more involved – chasing associated object chains, determining folder paths etc. However, it’s very similar to the metadata work we’ve done in our Metacoda Security Plug-ins – it’s quite easy to write the C# code when you’ve already done it in Java :) . The harder part for me was the .NET and custom tasks side of things and that’s where Chris’ book was very helpful in accelerating things that would have otherwise taken me much longer to discover from the reference docs and some trial and error.
Thanks a lot for sharing, Paul. Your courteousy goes beyond my modest means since I am not versed in .NET coding. Before posting, I perused the IT Developer Guide for Windows but was unable to track down the Authentication Service documented separately in the *.chm file. Well spotted.
Your code is easy to follow because of the many comments that surround it. I like it that way. Lots of praise for helping the community with such useful code ! You’re not many steps away from rebuilding the metabrowser from scratch as an EG Plug-In, it seems ;-).