BookmarkSubscribeRSS Feed
Yura2301
Quartz | Level 8
Hello,
So in general I am working on macro which has one parameter - name of ETL(DI studio Job) , and as result this macro must create table with list of source to this ETL tables.
For all this goals I use proc metadata and I've almost finished, but one issue appears - name of table in General tab of property menu can be different from real table name which can be find in "Phisical storage" tab.

Shortly about how it works- I create XML tamplate with appropritate structure and give it to proc metadata as parameter, and as result creates result XML file which consists of all needed data:

filename in "&workPath\in.xml";
filename out "&workPath\result.xml";

data _null_;
file in;
put '';
put '$METAREPOSITORY';
put 'Job';
put 'SAS';
put '';
put '404';
put '';
put "%bquote()";
put '';
...

proc metadata
header=full
in=in
out=out;
run;

After this I create XMLMap for getting source tables info,It looks like this:

filename xmlMap "&workPath\xmlMap.xml";
data _null_;
file xmlMap;
put '';
put '';
put '';
put '//Job/JobActivities/TransformationActivity/Steps/TransformationStep/Transformations/ClassifierMap/ClassifierSources/PhysicalTable';
put '';
put '//Job/JobActivities/TransformationActivity/Steps/TransformationStep/Transformations/ClassifierMap/ClassifierSources/PhysicalTable/@Id';
put 'character';
put 'string';
put '32';
put '
';
put '';
put '//Job/JobActivities/TransformationActivity/Steps/TransformationStep/Transformations/ClassifierMap/ClassifierSources/PhysicalTable/@Name';
put 'character';
put 'string';
put '256';
put '
';
put '';
put '//Job/JobActivities/TransformationActivity/Steps/TransformationStep/Transformations/ClassifierMap/ClassifierSources/PhysicalTable/@Desc';
put 'character';
put 'string';
put '256';
put '
';
put '
';
put '
';
run;

And then I extract source tables:

libname xmllib xml "&workPath\ResultData.xml" xmlmap=xmlMap;

data WORK.JobSourceTables;
set xmllib.JobST1;
run;

But as I describe in begining of this post - name of table in general tab can be different from real physycal table name which can be find in "Phisical storage" tab.

The root of this question can be related with appropriate path to physical table, in my case it is:
//Job/JobActivities/TransformationActivity/Steps/TransformationStep/Transformations/Select/ClassifierSources/PhysicalTable/@Name

But this path gives table name from general tab of property table, but I need name from "Physical storage" tab, and in documentatiuon I couldn't find how to get this.
"PhysicalTable" attribute 3 sub-attributes @id,@name and @desc sub-attributes...So may be I must check somewhere higher in tree...

Thanks in advanced!

Message was edited by: Yura2301

Message was edited by: Yura2301

Message was edited by: Yura2301

Message was edited by: Yura2301

Message was edited by: Yura2301 Message was edited by: Yura2301
2 REPLIES 2
Tim_SAS
Barite | Level 11
Hi Yura2301.

This forum is for general questions about SAS procedures.

The SAS Enterprise Data Management & Integration Forum is dedicated to the kind of of question you're asking. If you post your question there it will be seen by more knowledgeable people. Good luck!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 616 views
  • 0 likes
  • 2 in conversation