BookmarkSubscribeRSS Feed
Yura2301
Quartz | Level 8
Hi all,
I know that proc metadata can extract almost all from DI studio(tables, Jobs, transformations names, columns etc.) but I didn't found that it can extract also some source code of transformation from some concrete ETL.
So I have general question:
Can I somehow(by proc metadata etc.) dinamically extract source code of some transformation in some concrete ETL?
For example, I have DI studio job(ETL) which has few transformations , and one of them - "user written code"( or simple "SQL join" it's not important) and I need get source code of this transform without connecting to DI studio manually, for example by running some standard proc metadata(or another procedure) with appropriate XMLmap and another options in Enterprise Guide.

So is it possible get such information?

Thanks!
7 REPLIES 7
DaveR_SAS
SAS Employee
Yura,

In most cases the source code is not stored in the metadata for each transformation in a DI Studio job. Usually the source code for each transformation is generated at runtime from the metadata.

It is possible for user-written code to be specified for any transformation, and that user-written code can be stored in the metadata or in a file. But most jobs use transformations that generate the appropriate code at runtime, based on the metadata.

Dave
Yura2301
Quartz | Level 8
Hi Dave,
Thanks, It's clear.
Just for clarify one thing - So if I use transform "User written code" and I specify type "Metadata"(not "File") so I should be able to extract this code using proc metadata?


Thanks! Message was edited by: Yura2301
CameronLawson
Obsidian | Level 7
Custom code stored in Metadata is in the TextStore of the Metadata server. Use GetMetadata to view it and choose SourceCode.
LinusH
Tourmaline | Level 20
Just a bit curious, what do you want to do with this?

/Linus
Data never sleeps
Yura2301
Quartz | Level 8
Hi Linus,
I needed collect some info which is stored in User-written codes(for example - macroes which are used by this UW code, marts etc.).
So shortly - I'll collect appropriate UW from some ETLs, then parse their codes and extracts some useful info from them.
Actually I connected to TextStore of UW transforms by using "metadata_getXXX" functions.

Strange that you asked, I suppose that it is common task - collect some info from metadata objects...

Thanks!
LinusH
Tourmaline | Level 20
It is a common task, I have done it myself (but not User Written Code).
My gut feeling was that it would be easier to scan the deployed job code than search through the metadata.

/Linus
Data never sleeps

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 1493 views
  • 0 likes
  • 4 in conversation