Help needed with job design

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

Post Reply
Marcus426
Participant
Posts: 33
Joined: Wed Sep 09, 2009 1:37 am

Help needed with job design

Post by Marcus426 »

Hi all,

Newbie here.
Can you guys please help me out with a job design. Here are the details.

I have a fixed length file containing a lot of headers(journal) and details(journal). The header records are distinguished from the detail by a column( Has 'A' for header, blank for detail). I have to do a lookup on this file and based on the lookup have to do some transformations separately on the header and the detail and again load them to a same file. Can anyone please tell me the logic of how to achieve this( seperate transformations on header & detail). Sorry, if this is too simple of a question.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Let's assume you have a file:

Code: Select all

Header1
Detail1.1
Detail1.2
Header2
Detail2.1
Detail2.2
Detail2.3
[code]

What sort of a lookup do you need to do, i.e. does Detail2.2 need to look at Header1?
Marcus426
Participant
Posts: 33
Joined: Wed Sep 09, 2009 1:37 am

Post by Marcus426 »

Arndw,

sorry for the confusion.


The lookup altogether is against a different file based on key columns common to both headers and details. I need to do transformations separately on all headers (header1, header2.....) and all details (detail1.1,detail1.2..........) and load them to target in the same order as source file. please let me know if I am still confusing.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

What you have provided is full flow with no detail. It leaves lots of questions like
1.) What column in source is used to fetch data?
2.) What value in the reference must match and what is returned ?
3.) Must that happen for all rows or only on specific condition?

Maybe you can try to work on it and provide the bits you find difficult.
Grace J.
Participant
Posts: 22
Joined: Mon Nov 03, 2008 5:34 am

Post by Grace J. »

As per my understanding of your requirement,,,

If you have seperate key columns in both source and reference files, you can do lookup based on that key columns and then in a transformer you can check for the column (which seperates header and details) . If that column equals A, then do calculation for header else do calculation for detail.

I hope you will get the records in same order as output. If not sort the records after source and preserve the sort order till the output stage
Post Reply