Page 1 of 1

Transformers columns and value

Posted: Wed Nov 28, 2007 7:54 am
by bart12872
Hi,

With a routine, i want to retrieve all the output columns of a tranformer and the values

for exemple
transformer_name;output1; Ln_input.COL1
output2; Ln_input.COL2
...

Is it possible ? and How to do that ?

thanks,
Martin.

Re: Transformers columns and value

Posted: Wed Nov 28, 2007 8:02 am
by gateleys
Why do you need a routine? Why not just pump your output to a sequential file with the first row set to Column Names. You'd get both column names and their values.

Posted: Wed Nov 28, 2007 8:14 am
by bart12872
In fact, the idea is to analyse transformers of 200 jobs.

I want to retrieve the value of the column 'REJ_TYP' for all transformers with this column.

in fact, i wrote a routine to list all the jobs and list all transformers in a job but i don't know how to retrieve column information

that's why i use routine to boucle with a for statement.

Posted: Wed Nov 28, 2007 8:29 am
by gateleys
bart12872 wrote:in fact, i wrote a routine to list all the jobs and list all transformers in a job but i don't know how to retrieve column information

that's why i use routine to boucle with a for statement.
Of course you could write a routine to list jobs and their stages since these information are kept in DS_JOBS and DS_JOBOBJECTS files in the DS repository. However, for actual column values, you will have to dig them from the output files that share no relationship with the repository tables. So, you will not be able to get the value from your approach.

For the column names and values, I recommend that you get them from output sequential files as I suggested in my prior post. You could, however, name your file prefixed by the jobname and transformer name so that in your routine, you can include a code segment to read the 'appropriate' file for each job (based on job and transformer names).

Posted: Wed Nov 28, 2007 8:49 am
by bart12872
I can't modify all jobs it will take too long time.
but I'm asking a question, for curiosity, data are stored in project folder.
there is DS_JOBS, DS_JOBSOBJECTS, DS_METADATA and more, but there's also DS_TEMP594, RT_BP594, RT_BP594.O
(By UV request I'm supposed that 594 is the job id).
This last one contain the file V35S1_JxIPDV_Dept_GCO_Pk_Transformer_12.o
column and value must be stored there.

Can I read this object file ? Can I decompile it ?

Posted: Wed Nov 28, 2007 9:17 am
by gateleys
Again, there is no way you can get the column value from any of those repository tables. That is a fundamental design of any software... separate your objects from the data.

The BP (Basic Programs) files do NOT store column values.

Posted: Wed Nov 28, 2007 3:08 pm
by ray.wurlod
Column values only exist while a row is being processed. They are not stored anywhere within DataStage. Therefore the answer to your original question is that it is not possible to "get" the values other than within the job design itself, as others have noted.

Posted: Thu Nov 29, 2007 3:14 am
by bart12872
ray.wurlod wrote:Column values only exist while a row is being processed. They are not stored anywhere within DataStage. Therefore the answer to your original question is that it is not possible to "get" the values ...
In fact, this is not a 'value' I want to get but the derivation value in the transformer. When I open a job design, I can see it. Datastage must stock this info, no?

I sure at 99% this is possible to do that in Datastage server but in PX I don't know !!

Posted: Thu Nov 29, 2007 1:53 pm
by ray.wurlod
Assuming you mean the derivation expression, yes of course it's stored with the design-time metadata. However no tools are provided with the product to accessing this information, so you would need to learn the internal structure of a parallel Transformer record in wherever it's stored in the Respository (and did you want the design-time, BASIC-like expression or the generated C++ expression?). This is not documented anywhere.