Page 1 of 1

Multi value used in hash file

Posted: Mon Jul 22, 2013 3:19 am
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

Posted: Mon Jul 22, 2013 5:40 am
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?

Posted: Mon Jul 22, 2013 5:50 am
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 ?

Posted: Mon Jul 22, 2013 6:01 am
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)?

Posted: Mon Jul 22, 2013 6:06 am
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

Posted: Mon Jul 22, 2013 6:20 am
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?

Posted: Mon Jul 22, 2013 6:28 am
by CLOPES
yes 7 output rows

Posted: Mon Jul 22, 2013 7:09 am
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.

Posted: Mon Jul 22, 2013 7:43 am
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.

Posted: Tue Jul 23, 2013 7:17 am
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.

Posted: Tue Jul 23, 2013 2:56 pm
by rameshrr3
@chulett - not meaning to hijack , but how will you read a hashed file as an UV table ?

Posted: Tue Jul 23, 2013 2:57 pm
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.

Posted: Tue Jul 23, 2013 3:18 pm
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.