hi folks,
i have a column with datatype decimal(9,0) from mainframe and i want to convert it to varchar and insert into another database.
Basically, i want to do a decimal to varchar conversion. i tried using DecimalToString but i could not get the syntax correct.
can u pls help me....thnx.
decimal to varchar
Moderators: chulett, rschirm, roy
Simply moving it from a decimal to a varchar will 'convert' it for you. If you need something specific, throw a FMT() in there with it.
ps. Is this a Server question? DecimalToString is a PX thing, but you are in the Server forum and marked it as Server, hence the confusion...
ps. Is this a Server question? DecimalToString is a PX thing, but you are in the Server forum and marked it as Server, hence the confusion...
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Re: decimal to varchar
You are on server platform and maybe thats why the DecimalToString function doesnt work. Its just available in px. Server is lineant in data type conversions and doesnt fuss about it. PX on the other hand needs explicit conversions.DSbox61 wrote: i tried using DecimalToString but i could not get the syntax correct.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Data source is specified as mainframe, we assume pushed to your DataStage server machine. Server jobs have no internal data types, so within the job the decimal number is simply a string of characters. That is why all you need to do is specify it as VarChar on the output link of a Transformer stage - no function is required to effect the transition.
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.
Thnx for the help guyz....and craig, i am on server edition...i was just trying decimaltostring function to see if it can help me in any way...
i resolved the issue by converting it to char as part of the sql query, tht i used in db2 stage and then trimmed the trainling dot(.) in transformer stage. i get the trailing dot since data type is decimal (9,0)....For Ex: if i convert 1234 from decimal to char i get it as 1234.
thnx guyz....
i resolved the issue by converting it to char as part of the sql query, tht i used in db2 stage and then trimmed the trainling dot(.) in transformer stage. i get the trailing dot since data type is decimal (9,0)....For Ex: if i convert 1234 from decimal to char i get it as 1234.
thnx guyz....