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.
To Use Modify Stage
Moderators: chulett, rschirm, roy
To Use Modify Stage
Thanks and regards
raman
raman
Re Modify
Please find the below code and change it as ur need .
<NEW_VAR>:string[6] = string_trim[NULL,end,begin]<OLD_VAR>
<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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Thank you Ray
Thank you very much Ray, Hope you had good time in Bangalore,
Thanks and regards
raman
raman
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: