hi all,
i want to append a new column from a file which has only 1 row to another file which has three other columns. i do not have any common columns. but the output file should have all the rows of the second file populated with the same data of the only row in the first file.
for example:
**first file**
date
2004-01-19
**second file**
no code perm
1 A y
2 B n
3 C y
**output file**
date no code perm
2004-01-19 1 A y
2004-01-19 2 B n
2004-01-19 3 C y
i tried using a merge stage and a transformer, but did not get the required output.
can anyone suggest?
thanks.
append column
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
You could also open file 1 using a routine and retrieve the value. Pass this value into your job as a job parameters. Use the job to retrieve the contents of file 2 and output the job parameter with each row of file 2.
It is quite easy in a Sequence job to set a job parameter by calling a routine. In your job stage set the Value Expression to the name and input arguments of your routine.
Name Value Expression
INPUTDATE rGetInputDate(FilePath:InputFileName)
The routine opens the file and returns the date to the Value Expression.
It is quite easy in a Sequence job to set a job parameter by calling a routine. In your job stage set the Value Expression to the name and input arguments of your routine.
Name Value Expression
INPUTDATE rGetInputDate(FilePath:InputFileName)
The routine opens the file and returns the date to the Value Expression.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
-
- Premium Member
- Posts: 385
- Joined: Wed Jun 16, 2004 12:43 pm
- Location: Virginia, USA
- Contact:
On Craig's hashed file design, enable the Pre-load file to memory option in the Hashed File stage.
Chuck Smith
www.anotheritco.com
www.anotheritco.com
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom