Multi value used in hash file

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
CLOPES
Participant
Posts: 52
Joined: Tue Jul 22, 2003 8:05 am
Location: France
Contact:

Multi value used in hash file

Post by CLOPES »

Hello,

want to use the MV in hash files but i don't remember how.

My keys IN are column 1 and column 2 and OUT column 3 and 4.
Knowing that 3 and 4 are S and 1 & 2 MV
Where am i wrong because the stage hash doesn't work ?

Thanks
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I'm not quite sure of what you are trying to do. Are you asking how discrete values can be extracted, or how they are written?

A hashed file has only one key field, but that can be a multivalue field. Is this the case here?
CLOPES
Participant
Posts: 52
Joined: Tue Jul 22, 2003 8:05 am
Location: France
Contact:

Post by CLOPES »

Hello,

My needs are :

1 row from a text file ---> trsf ------> hsh file

with a look up with an OCI where i'm suposed to retrieve 7 rows.

So 1 ROW to 7 ROWS.

So from my old development years, i remember i managed that with a hash file with VM rows.
Am i wrong ?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You remember correctly, in principle that is correct. But I'm still unclear as to which columns contain multivalues and what the lookup is to look like.

Your 1 row source contains how many columns - 4? Columns 1 & 2 have multiple values (separated by what character)?
CLOPES
Participant
Posts: 52
Joined: Tue Jul 22, 2003 8:05 am
Location: France
Contact:

Post by CLOPES »

My 1 row source have just one row with a group establishment.

The OCI lookup will generate 1 row with all the establishments multi valued.
Then i want to generate 7 rows from using a hash file.

PS : I'm rusty :D
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Dom?

Ok, So your data contains a key, then you look up a reference hashed file with that key and one MV column with 7 values? And you wish 7 output rows?
CLOPES
Participant
Posts: 52
Joined: Tue Jul 22, 2003 8:05 am
Location: France
Contact:

Post by CLOPES »

yes 7 output rows
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I can't check right now, but I believe you can set a "normalize" drop-down menu in the hashed file stage on a multivalue column.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Another option: Write it out with X keys to a normal hashed file. Lookup up against it with <X keys using the UV stage. Enable the 'multi-row return' property.
-craig

"You can never have too many knives" -- Logan Nine Fingers
CLOPES
Participant
Posts: 52
Joined: Tue Jul 22, 2003 8:05 am
Location: France
Contact:

Post by CLOPES »

I've found a solution.
Instead of having a file's one row, i've changed it to an OCI with the select i wanted.
thanks to everyone.
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post by rameshrr3 »

@chulett - not meaning to hijack , but how will you read a hashed file as an UV table ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

All UV tables are hashed files.

Not all hashed files are UV tables. However every hashed file with a consistent record structure can be read as if it were a UV table.

VOC and DS_JOBOBJECTS are examples of hashed files that do not have consistent record structure.
Last edited by ray.wurlod on Tue Jul 23, 2013 4:43 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It just needs a VOC record, so you'd have to create it for a pathed hashed file otherwise it already has one. And then it can be accessed using the UV stage via 'localuv' from what I recall.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply