Re-order metadata in column definition

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
Developer9
Premium Member
Premium Member
Posts: 187
Joined: Thu Apr 14, 2011 5:10 pm

Re-order metadata in column definition

Post by Developer9 »

Hi ,

I am looking for a way to re-order metadata (Drag and Drop something like we do it in a transformer stage or other stage that supports mapping ).

Ex:Sequential file stage -output --columns tab

I tried re-order desired column order --map back to the sequential fie stage )

Code: Select all

Seq --xfm stage


Thanks.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What are you ultimately trying to accomplish? If you want to re-order the columns in a sequential file, you'll need to create new metadata for that.

Edited to add: My reply was based on creating a sequential file but looking more closely I see that it is your source. So I do have to admit I don't see the point of what you are doing as you have no choice in how a sequential file is read. Of course you can re-order them afterwards as noted but I'd still like to know what brought you here to ask this question, what are you ultimately trying to accomplish? :?

Meaning, sometimes it's better to start with the actual problem you are attempting to solve rather than focusing on your solution without ever mentioning the problem. :wink:
Last edited by chulett on Fri Aug 19, 2016 8:03 am, edited 2 times in total.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

Workaround: You can reorder the input columns of a transformer stage.

1) Add a temporary transformer stage.
2) Move the output link of your sequential file to the transformer.
3) Use the transformer to reorder its input columns.
4) Move the link back to its original position.
5) Delete the temporary transformer stage.

This works because the column metadata is associated with the link and not the source stage.

** Edit ** Just noticed you are already attached to a transformer. No need for a temporary transformer in that case. Just reorder the columns on the input side of your transformer.

Mike
Developer9
Premium Member
Premium Member
Posts: 187
Joined: Thu Apr 14, 2011 5:10 pm

Post by Developer9 »

@Chulett,
This is actually not a problem but some reason we change the source file column order just curious since many years we have an option to re-order the existing columns in the columns tab it self with out having to use transformer or other temporary stage for this purpose
For Example :In my column metadata I want to move the columns similar to functionality stages supporting Link ordering with Arrows for re-order
I am sure there is no functionality exist as such at least recent versions currently 11.5 but want to check with the forum for any tips to save time in development :)
Developer9
Premium Member
Premium Member
Posts: 187
Joined: Thu Apr 14, 2011 5:10 pm

Post by Developer9 »

@Mike ,Tried that option already :)..Thank you
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The functionality is there, including in version 11.5.

In the Columns grid (in the bottom right quadrant of the Transformer stage, or in the downstream Sequential File stage), select the Column name and then use your right mouse button to drag a column (up or down) to its new position.

You can also achieve the same in the upper right quadrant of the Transformer stage, except that you must use the left mouse button to drag the column definition up or down in the order.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Developer9
Premium Member
Premium Member
Posts: 187
Joined: Thu Apr 14, 2011 5:10 pm

Post by Developer9 »

Thanks ray ..this is what I am expecting will check once we have 11.5 available :)
Post Reply