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
Normalize a field on Parallel EXTENDER PX
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 5
- Joined: Thu Jun 02, 2005 1:33 pm
-
- Participant
- Posts: 232
- Joined: Sat May 07, 2005 2:49 pm
- Location: USA
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,
![Smile :)](./images/smilies/icon_smile.gif)
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,
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
-
- Participant
- Posts: 5
- Joined: Thu Jun 02, 2005 1:33 pm
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):
IHTH,
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
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)