Sort/group your data in the file by the group-by fields, then use stage variables to concatenate rows and output the concatenated row when the group-by fields break. You will have to add a trailing row to the source data to signal the end of the data file so that you can output the last row. This technique has been covered on the forum. If you can't find it, I'll check back later and help you.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Hi Nag,
Can you please let me know, if you are thru in ur logic.
Can you please provide me the solution, since i am also stuck up with this kind of logic.
What you do is setup a stage variable to keep concatentating the values until there's a break, and output on a break. You will use a stage variable as the constraint expression. You can do it, just experiment, it will look easy after you figure it out.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
vdr123 wrote:Can I use COLUMN EXPORT STAGE to do the flattenning part(vertical pivoting) of the data???
Can we use any of the other Restructure stages available in PX 7x?
Is there other way to do it without using the concatenation of fields suggested....
Please give you feedback ASAP....its URGENT!!!
Rather than ask "can I...", why not try, and report your results?
How would you envisage using a column export stage? What other restructure stages did you have in mind? What approaches have you tried already?
There are at least three ways to design this task in DataStage. I still believe that the approach using stage variables, which has already been posted (Ken, the poster, has nearly 1000 posts on the Forum, and concomitant experience with the product), will be the most efficient.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vdr123 wrote:Can I use COLUMN EXPORT STAGE to do the flattenning part(vertical pivoting) of the data???
Can we use any of the other Restructure stages available in PX 7x?
Is there other way to do it without using the concatenation of fields suggested....
Please give you feedback ASAP....its URGENT!!!
But your post states you're on Windows. So why ask about PX?
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
How can I control the output from the transformer stage to the output...what type of contraint can i use to output(when it breaks)
I am using stage variables like: new, old, CODE.
Any feedback would be highly appreciated and helpfull.
ray.wurlod wrote:vdr123 isn't the original poster.
vdr123's the one with the urgent PX requirement!
Okay, shame on the second poster for stacking a different issue on this post. Start a new topic next time!
Sorry so crabby, home sick with the flu, wife and kids sick also.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
How can I control the output from the transformer stage to the output...what type of contraint can i use to output(when it breaks)
I am using stage variables like: new, old, CODE.
Any feedback would be highly appreciated and helpfull.
If what you want in the output is input.field3 then input.field1, then this is exactly what you are seeing. Because you've declared field1 to be some kind of character string in the output, it is being quoted. You can change the quote character in the Format specifications for the Sequential File stage.
If what you want is a single column, with the value of input.field3 concatenated with the value of input.field1, then use the expression editor. First choose input.field3 from the operands, then choose concatenate from the operators, finally choose input.field1 from the operands. Voila! Your expression.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Capture field3 into a stage variable, with a preceding stage variable to detect whether the value in field3 has changed.
Accumulate the concatenated string in yet another stage variable.
Constrain the Transfomer output to generate output only where the value of field3 changes (and @INROWNUM <> 1).
Make sure you process the final input line, perhaps by pre-generating a dummy last line in the input file.
All these techniques can be found by searching the Forum.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.