Hi All,
I have I/P is
EMPNO
1
2
3
I want O/P
EMPNO
1,2,3
DataStage Scenario?
Moderators: chulett, rschirm, roy
Reply
In transformer create dummy deptno column and hard code 1.
Then in another transformer
deptno - partition hash, sort ascending
empno - no partition, sort only ascending
stage variable :
svempno :- if input.deptno = svdeptnold then svempnold :',': input.empno else input.empno
svdeptnold :- input.deptno
svempnold :- svempno
you can also modify the svempno stage variable to include the deptno :
svempno :- if input.deptno = svdeptnold then svempnold :',': input.empno else input.deptno:',':input.empno
Then in another transformer
deptno - partition hash, sort ascending
empno - no partition, sort only ascending
stage variable :
svempno :- if input.deptno = svdeptnold then svempnold :',': input.empno else input.empno
svdeptnold :- input.deptno
svempnold :- svempno
you can also modify the svempno stage variable to include the deptno :
svempno :- if input.deptno = svdeptnold then svempnold :',': input.empno else input.deptno:',':input.empno
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
![Evil or Very Mad :evil:](./images/smilies/icon_evil.gif)
I am seriously considering deleting posts that literally contain nothing but input and output examples. We must put an end to this madness. I cannot say this enough -
Spell out your requirements in words
Tell us what you've tried
Tell us what issues you've had
Do not simply drop off your dirty laundry here.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers