-1

I need to merge 3 input files into 1 output file via datastage, may I know how to achieve this?

Background: The 3 input files have different fields (layout)

example:

Input file A: HDR123

Input file B: 000123

Input file C: TRL003

Expected output:

HDR123

000123

TRL003

jwj
  • 1
  • 1

2 Answers2

0

You can use the funnel stage for this but the data types and length need to match (similar to a union in SQL).

MichaelTiefenbacher
  • 3,805
  • 2
  • 11
  • 17
0

You can achieve this in datastage by defining two jobs: Job-1. parallel job: sequential file -> sequential file Job-2. sequence job: startloop activity -> job activity -> endloop activity

Define job-1 as follows: source sequential file Define job parameter, say #INPUT# and use this value as file name in the file path, say : /tmp/#INPUT#

i.e. input files are /tmp/A, /tmp/B and /tmp/C

target sequential file Output file, say /tmp/out.txt File update mode : Append

Define job-2 as follows: start loop activity : Loop definition -> delimited values : A,B,C (Delimiter comma)

job activity: Job name = above job-1 Parameters : INPUT = StartLoop_Activity_0.$Counter

Now compile both job-1 and job-2 Run sequence job job-2. You will expected result in /tmp/out.txt

Please note that, if you run the sequence job again, you will see the same contents appended again, so you need to make sure you have no file called /tmp/out.txt before running sequence job or it is empty.