Page 1 of 1

Normalize a field on Parallel EXTENDER PX

Posted: Wed Jul 27, 2005 10:40 am
by androus17121
Hello,
I was wondering if anyone know or perhaps provide some solution to the following?

I need normalize each row on a field. I know we can do it with hashed file bu i'm developping on parallel job.

source :
TABLE1 (ID_COUNTRY, LANGUAGE) --> the column LANGUAGE is very variable from NULL to 400 sites
row1 --> [1, "US, FR, IT, GR"]
row2 --> [2, "GR, BG"]


my objectif :
TABLE2 is (ID_COUNTRY, LANGUAGE)

[1, "US"]
[1, "FR"]
[1, "IT"]
[1, "GR"]

[2, "GR"]
[124, "BG"]

I work with DSv7.5.1 EE, AIX 5.2 and ORACLE 921

Thanks in advance

Posted: Wed Jul 27, 2005 1:29 pm
by pnchowdary
Hi,
I know we can do it with hashed file bu i'm developping on parallel job.
Why don't you try to use Lookup,Join or Merge stage to achieve this, as these are all parallel job stages, equivalent to a hashed file?

Posted: Thu Jul 28, 2005 2:57 am
by roy
Hi And welcome aboard :),
You could read the data and in a transformer build a row foreach element (use Convert to change the comma to LF) to a seq file;
So you should get something like:
1
US
FR
IT
GR
2
GR
BG
After you have this simply read the file and store the number in a SV (stage Variable) building the new rows by concatenation of SV and values and constrainting the numeric values not to output in a constraint.
After this you should have:
1,US
1,FR
1,IT
1,GR
2,GR
2,BG

IHTH,

Posted: Mon Aug 01, 2005 9:10 am
by androus17121
Thank you Roy your solution,

i succeeded to create a sequential flat like that :

<LINE>
1
US
FR
IT
GR
2
GR
BG

but i didn't find how i can store my number in a stage variable for having in output :

<ID_COUNTRY>,<LANGUAGE>
1,US
1,FR
1,IT
1,GR
2,GR
2,BG

Thanks in advance,

Posted: Mon Aug 01, 2005 11:29 pm
by roy
Hi,
The logic is quite simple:
Sv = Stage variable

No EE avail now so can't recall specific routine for testing numeric value!,
So find it and replace that in the "code" below


The code Should be something like this (might need debugging no DS avail):

Code: Select all

SvIsNewNumber  <<
 If <TestNumericRoutine>(Link.col) And Link.col <> SvPrevNumber Then @TRUE Else @FALSE
SvNewNumber     <<
 If SvIsNewNumber Then Link.col Else SvOldNumber
SvOldNumber <<
 If IsNull(SvOldNumber) Or SvIsNewNumber Then Link.col Else SvOldNumber
IHTH,