Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nulls in hash file 2

Status
Not open for further replies.

ritanya

Technical User
Mar 3, 2004
7
IN
Hi All,

I'm having null values to most of the columns (apart for key column)and i need to pass through hash file. My question is, how the hash file will react or treat for the null columns? help me.

Thanks in advance.

Ritanya
 
>I'm having null values to most of the columns
>(apart for key column)and i need to pass through
>hash file.

Hi Ritanya,

Can you please clarify what you are trying to achieve? Are you simply trying to write null values to a hash file, or are you using a hash file as a reference table in an attempt to eliminate the null columns from your original input data?

I may be able to help you out, but Im not sure what you are trying to achieve at the moment.

J
 
Hi J,
I'm using hash file as a reference table in an attempt to eliminate the null columns from my original input data. Also, i would like to know how hash file handles the null values????

Thanks
 
Hi,

Your hash file will handle the null values however you tell it to.

For example, say your job is something like the following (this is a mega simle example):
HASH_FILE
|
|
lnkLookup
|
|
V
INPUT_FILE ----lnkInput---->TRANSFORMER----lnkOutput---->OUTPUT_FILE

For this example:
* lnkInput & lnkOutput are stream links
* lnkLookup is your reference link (ie. your lookup to the HASH_FILE)
* All files contain 2 fields, "Client_Number" and "Client_Name"
* In the INPUT_FILE, the Client_Name field may be null
* In the HASH_FILE, the Client_Name field is not null
* In the OUTPUT_FILE, the Client_Name field will be derived from HASH_FILE if it is null in the INPUT_FILE

Firstly, in the transformer stage you will need to link INPUT_FILE.Client_Number to HASH_FILE.Client_Number so that the lookup works.

Secondly, in the column derivation for OUTPUT_FILE.Client_Name you will need to have something like (the syntax here isnt 100% correct):
if ((len(INPUT_FILE.Client_Name)=0 OR (INPUT.FILE.Client_Name=@NULL)) AND (len(HASH_FILE.Client_Name) > 0)) then
HASH_FILE.Client_Name
else
INPUT_FILE.Client_Name

Hope this helps

Cheers
J
 
Woops....looks like my little diagram got messed up. In case you didnt figure it out, the lnkLookup is meant to connect to the TRANSFORMER.

J
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top