RCP and adding new columns to flow

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

juancho
Premium Member
Premium Member
Posts: 22
Joined: Thu Oct 04, 2007 1:09 pm
Location: Argentina
Contact:

RCP and adding new columns to flow

Post by juancho »

Hello!

I am trying out Runtime Column Propagation (RCP) using a simple sequential file (reading the metadata from a Schema file), a Transformer and another sequential file to write the data to.

What do i need to do:
Add a date column to the flow.

What do i have:
Just three columns, lets suppose i have this file:

col1,col2,col3
100,200,300

i read it using RCP and a schema file then process it and i want this as output:

date,col1,col2,col3
20090303,100,200,300

Is there any way to do that using RCP? because i have like 40 jobs where the only thing i have to do is this (well that and write from text to dataset) and i would love to save the development time.

Currently, adding a single column in the transformer stage writing the date only returns:
20090303

and none of my original schema read columns.

Any help? maybe another way to do it?

Thanks!
--
Juan José Sisti
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Add a column generator instead of transformer.

That can use schema.
miwinter
Participant
Posts: 396
Joined: Thu Jun 22, 2006 7:00 am
Location: England, UK

Post by miwinter »

Have you verified that RCP is enabled at the project level?
Mark Winter
<i>Nothing appeases a troubled mind more than <b>good</b> music</i>
juancho
Premium Member
Premium Member
Posts: 22
Joined: Thu Oct 04, 2007 1:09 pm
Location: Argentina
Contact:

Post by juancho »

I have verified that RCP is enabled.

I am trying the column generator option, but how do i do so it uses certain function while generating the data?

the only option i see is
Cycle (cycles thru several options)
Alphabet (chooses one letter each time from a chosen string)


Thanks in advance!
--
Juan José Sisti
miwinter
Participant
Posts: 396
Joined: Thu Jun 22, 2006 7:00 am
Location: England, UK

Post by miwinter »

What is the 'certain function' you want to apply? From your example, I think we (at least I was) assumed you were using a literal each time. If it's more complex than that, this stage won't suit as it's intended to produced test data really, providing the same value over and over or working around a list over and over. It can't employ transform functions if you are wanting to do something fancier with your date you want to add.
Mark Winter
<i>Nothing appeases a troubled mind more than <b>good</b> music</i>
juancho
Premium Member
Premium Member
Posts: 22
Joined: Thu Oct 04, 2007 1:09 pm
Location: Argentina
Contact:

Post by juancho »

Well i need to add the current date to the new column, so that is as complicated as it gets...

any ideas? i am fiddling with Funnel to see if i can get anything done by merging two flows...
--
Juan José Sisti
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Modify stage !!??
juancho
Premium Member
Premium Member
Posts: 22
Joined: Thu Oct 04, 2007 1:09 pm
Location: Argentina
Contact:

Post by juancho »

But for Modify Stage i need to define the columns i KEEP and DROP, i cannot add a new column there and i want to use RCP.

Maybe i'm wrong about it...
--
Juan José Sisti
juancho
Premium Member
Premium Member
Posts: 22
Joined: Thu Oct 04, 2007 1:09 pm
Location: Argentina
Contact:

Post by juancho »

I think the only solution is to process the file as a whole huge record and then add another column (having the current date) at the transformer level, this should be done in a first job, the second job should use RCP and i will already have [date]<separator>[original data], hence i will be able to use only one job.

And since the first job only reads the data as one huge record instead of delimited, i dont need to define any special metadata for any of the files.

that way with three jobs (the third being a dataset to oracle inserter) i am able to process all the files, only using schema definitions.

If anyone thinks of a better solution i am still open to your help!
--
Juan José Sisti
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Insert one extra dummy column in the column generator stage and drop it in the modify.
juancho
Premium Member
Premium Member
Posts: 22
Joined: Thu Oct 04, 2007 1:09 pm
Location: Argentina
Contact:

Post by juancho »

Sainath.Srinivasan wrote:Insert one extra dummy column in the column generator stage and drop it in the modify.
But i wont be able to fill that column with the current date, am i right?
--
Juan José Sisti
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You are not right.

The Generator property folder for a date data type includes Use current date as an available property to add.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
juancho
Premium Member
Premium Member
Posts: 22
Joined: Thu Oct 04, 2007 1:09 pm
Location: Argentina
Contact:

Post by juancho »

Thanks!

Solved it.
--
Juan José Sisti
aymancherif
Participant
Posts: 3
Joined: Tue Jan 11, 2011 10:25 am

Post by aymancherif »

hello juancho,

if u please can tell me how u solved this issue because i have the same situation here, i have huge number of jobs so i did enable the RCP and i want to add some new columns during transformation.

thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard. How do you expect juancho to know what U (one of our other posters) did?

Please strive for a professional standard of written English on DSXchange. It is a web site, not a mobile telephone, so there is no need for SMS-style abbreviations. Many of our posters (and lurkers) do not have English as their first language, so even good English is enough of a challenge for them.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply