SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

SAS 9.4 Metadata Model, TextStore for Code in Custom Transformation

Accepted Solution Solved
Reply
Respected Advisor
Posts: 4,173
Accepted Solution

SAS 9.4 Metadata Model, TextStore for Code in Custom Transformation

Hi All

Using SAS 9.4 I'm trying to figure out where in the SAS Metadata Model the code part of a DI Studio Custom Transformation is located.

What I want to do:

I have a bunch of DI jobs using a bunch of custom transformations calling a bunch of custom macros which I believe I can re-use on another site.

The macros called within the custom transformations have the site name in it. What I would like to do is to implement a script which renames all the SITE bits (in the Custom Transformation "template" and when used in a job). The Custom Transformations are all set to "automatic code creation".

I can't find the code location in the TextStore as outlined here for user written code.

Any idea where that could be stored or how I could find out?

Capture.PNG  Capture.PNG

Thanks,

Patrick


Accepted Solutions
Solution
‎06-14-2015 05:32 PM
PROC Star
Posts: 426

Re: SAS 9.4 Metadata Model, TextStore for Code in Custom Transformation

Hi Patrick,

Sorry for the confusion, that blog post must have been written before SAS 9.4 was released. That plug-in is certainly supported for use with SAS 9.4 and I use it extensively (it is also completely read-only at this point). The page https://www.metacoda.com/en/metacoda-security-plug-ins/sysreqs/ shows the SAS versions supported - essentially everything beyond SAS 9.2 I'll update the old blog post to indicate SAS 9.4 support. We did that metadata explorer search before the Search tab became available in SAS Management Console and we kept it afterwards because we still needed to search beyond public types in situations like this (and we still support older SAS versions that don't have the Search tab).

I mentioned V-lengths because, the way XMLSELECT works with V-lengths, you'll only be able to find the code fragment if it occurs fully within the first text page. I found this when searching for stored process code in metadata. In that particular case the SP code was in TextStore with a V-length of 1000 and so I could only find code fragments (using XMLSELECT) if the fragment occurred within the first 1000 characters of the SP code in metadata. To search beyond the V-length requires extracting metadata and searching outside of the metadata server.


Cheers

Paul

View solution in original post


All Replies
PROC Star
Posts: 426

Re: SAS 9.4 Metadata Model, TextStore for Code in Custom Transformation

Hi Patrick,

When I want to do a broad search for metadata like this I use our Metadata Explorer Plug-in to find the object and then trace the associations to any other interesting/required objects (finding metadata like this is one of the main reason's we developed this plug-in). I would search all model-type objects for something relatively distinguishing like '%site_macro_call('. You can read more about this plug-in in one of my past blog posts: Metacoda's Metadata Explorer Plug-in. It is one of our free utility plug-ins and just requires registration for an account to download and install it.

Alternatively you could also try the standard (but hidden by default) SAS Management Console XML Metadata Interface plug-in and try a variety of different queries to see if you can find what you need. Instructions on how to enable it can be found in this past SAS Global Forum 2012 paper: http://support.sas.com/resources/papers/proceedings12/009-2012.pdf

Something you might want to be aware of when searching metadata, if you haven't encountered them before, are V lengths.

Cheers

Paul

Respected Advisor
Posts: 4,173

Re: SAS 9.4 Metadata Model, TextStore for Code in Custom Transformation

Posted in reply to PaulHomes

Hi Paul

Thanks a lot. I'll certainly give your plug-in a go. I was aware of your security plug-in but didn't know that you've also implemented something to enhance the OOTB SMC search capabilities.

I've already tried using the Metabrowser and the XML Metadata Interface but to no avail (possibly also due to my ignorance).

You're homepage states that the Metacoda Plug-in is for SAS9.2 & 9.3. My stuff is actually under SAS 9.4 - I'll register anyway and give it a go. I assume that "searching" can't corrupt metadata.

Thanks,

Patrick

Solution
‎06-14-2015 05:32 PM
PROC Star
Posts: 426

Re: SAS 9.4 Metadata Model, TextStore for Code in Custom Transformation

Hi Patrick,

Sorry for the confusion, that blog post must have been written before SAS 9.4 was released. That plug-in is certainly supported for use with SAS 9.4 and I use it extensively (it is also completely read-only at this point). The page https://www.metacoda.com/en/metacoda-security-plug-ins/sysreqs/ shows the SAS versions supported - essentially everything beyond SAS 9.2 I'll update the old blog post to indicate SAS 9.4 support. We did that metadata explorer search before the Search tab became available in SAS Management Console and we kept it afterwards because we still needed to search beyond public types in situations like this (and we still support older SAS versions that don't have the Search tab).

I mentioned V-lengths because, the way XMLSELECT works with V-lengths, you'll only be able to find the code fragment if it occurs fully within the first text page. I found this when searching for stored process code in metadata. In that particular case the SP code was in TextStore with a V-length of 1000 and so I could only find code fragments (using XMLSELECT) if the fragment occurred within the first 1000 characters of the SP code in metadata. To search beyond the V-length requires extracting metadata and searching outside of the metadata server.


Cheers

Paul

Respected Advisor
Posts: 4,173

Re: SAS 9.4 Metadata Model, TextStore for Code in Custom Transformation

Posted in reply to PaulHomes

Hi Paul

And thanks once more.

"To search beyond the V-length requires extracting metadata and searching outside of the metadata server."

...and it was right in front of my nose and I've even already looked into the TransportMetadata.xml for other reasons but didn't realize that I can easily get from there where in the Metadata Model stuff gets stored. I was initially hoping I could do this text replacement directly in the .spk - but it corrupted it when I tried. Not sure why - may be some check sum or the like?

O.K., this was now a very valuable learning experience and I'm sure I'll never forget this one again.

Thanks,

Patrick

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 621 views
  • 7 likes
  • 2 in conversation