LKP stage in DS for XE/390

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
papan
Participant
Posts: 14
Joined: Mon Oct 17, 2005 12:28 pm

LKP stage in DS for XE/390

Post by papan »

I'm a rookie, I'm trying to read a flat file and looking up another flat file,
the object is send only those records whose fname exists in lookup file.
The job is able to read records from both primary source and lkp source, but unable to write it back to output.
Lookup condition:
DSLink4.EMP_FNAME=DSLink14.FNAME

Thanks
Data Mover
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

What do you mean by "unable to write it back to output"?

Mike
papan
Participant
Posts: 14
Joined: Mon Oct 17, 2005 12:28 pm

Post by papan »

[quote="Mike"]What do you mean by "unable to write it back to output"?

Mike[/quote]

The Job Details and the spool report is as follows:

Typically I've used 1 CFF stage (primary source), 1 FixedWidthFlatfile (lookup), Lookup Stage, and FixedWidth Flatfile (output).
There exists 6 matches in LKP. The process should write 6 records to output file.
RECORDS READ FROM DDNAME (PRIMARY SOURCE): 10
RECORDS READ FROM DDNAME (LOOKUP SOURCE) : 06
RECORDS WRITTEN TO DDNAME (OUTPUT FILE): 00

Thanks
Data Mover
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

Papan,

What is your setting for "Lookup technique"? What is your "Lookup condition"? What is your setting for "Action if lookup condition fails"?

I suspect that you have "skip row" for a failed lookup.

I think the records read count for your lookup source is the number of records that were preloaded to memory (hash technique or auto technique with an equality condition).

If you switch to "Null Fill" for a failed lookup you will get 10 records out.

There are 2 ways to get 6 records out:
1) Use "Skip row" which will skip all unmatched records (in your case probably all 10 are unmatched).
2) Use "Null Fill" and use an output constraint in a transformer immediately following the lookup stage to filter out unmatched rows (this technique makes debugging easier).

Best practice is to always insert a transformer stage immediately before and after a lookup stage.

Mike
papan
Participant
Posts: 14
Joined: Mon Oct 17, 2005 12:28 pm

LKP Stage in DS/XE390

Post by papan »

[quote="Mike"]Papan,

What is your setting for "Lookup technique"? What is your "Lookup condition"? What is your setting for "Action if lookup condition fails"?

I suspect that you have "skip row" for a failed lookup.

I think the records read count for your lookup source is the number of records that were preloaded to memory (hash technique or auto technique with an equality condition).

If you switch to "Null Fill" for a failed lookup you will get 10 records out.

There are 2 ways to get 6 records out:
1) Use "Skip row" which will skip all unmatched records (in your case probably all 10 are unmatched).
2) Use "Null Fill" and use an output constraint in a transformer immediately following the lookup stage to filter out unmatched rows (this technique makes debugging easier).

Best practice is to always insert a transformer stage immediately before and after a lookup stage.

Mike[/quote]

Mike,

I applied transform stage after LKP stage and also corrected the lkpfield metadata, works perfectly. Appreciated the clue..

Thanks a lot....
Data Mover
Post Reply