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
CLOPES
Participant
Posts: 52 Joined: Tue Jul 22, 2003 8:05 am
Location: France
Contact:
Post
by CLOPES » Mon Jul 22, 2013 3:19 am
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 » Mon Jul 22, 2013 5:40 am
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 » Mon Jul 22, 2013 5:50 am
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 » Mon Jul 22, 2013 6:01 am
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 » Mon Jul 22, 2013 6:06 am
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 » Mon Jul 22, 2013 6:20 am
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 » Mon Jul 22, 2013 6:28 am
yes 7 output rows
ArndW
Participant
Posts: 16318 Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:
Post
by ArndW » Mon Jul 22, 2013 7:09 am
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
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Mon Jul 22, 2013 7:43 am
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 » Tue Jul 23, 2013 7:17 am
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
Posts: 609 Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN
Post
by rameshrr3 » Tue Jul 23, 2013 2:56 pm
@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 » Tue Jul 23, 2013 2:57 pm
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
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Tue Jul 23, 2013 3:18 pm
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