To Use Modify Stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
ds_raman
Participant
Posts: 21
Joined: Tue Nov 27, 2007 3:10 pm

To Use Modify Stage

Post by ds_raman »

Hi all.

Can anyone help me in giving the syntax for converting a char datatype "which has numeric values" to integer or small int type's using Modify Stage.
Thanks and regards
raman
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Post by Teej »

You won't even need the modify stage, just use a copy stage, and let DataStage automatically convert it by automatically appending its own modify stage when you change the data type.

I know it's cheating, but there you go.
subrat
Premium Member
Premium Member
Posts: 77
Joined: Tue Dec 11, 2007 5:54 am
Location: UK

Re Modify

Post by subrat »

Please find the below code and change it as ur need .

<NEW_VAR>:string[6] = string_trim[NULL,end,begin]<OLD_VAR>

Teej wrote:You won't even need the modify stage, just use a copy stage, and let DataStage automatically convert it by automatically appending its own modify stage when you change the data type.

I know it's cheating, but there you go.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The data type between the ":" and the "=" in a Specification is that of the output field, not that of the input field. Therefore, if the output field needs to be integer, then int32 (etc.) must be the data type. There is no implicit convertion from string to integer, so you must provide a function such as (from memory) int32_from_string.

Code: Select all

OutCol:nullable int32 = int32_from_string(InCol)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ds_raman
Participant
Posts: 21
Joined: Tue Nov 27, 2007 3:10 pm

Thank you Ray

Post by ds_raman »

Thank you very much Ray, Hope you had good time in Bangalore,
Thanks and regards
raman
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you can't find an int32_from_string() function - I did mention that it was from memory - use decimal_from_string() and specify a scale of 0.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply