Convert string to numeric value

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
srai
Participant
Posts: 101
Joined: Wed Feb 09, 2005 10:50 pm

Convert string to numeric value

Post by srai »

Hi All,

Using execute command activity stage in datastage, i reading a text file which contain the record count. The out put this stage is being treated as string in DataStage while text file contains no only.
Is there any function in DataStage to convert string to numeric value.

For exp- my text contains count as 5000.
I am reading this 5000 using execute command activity (cat Unix command) as passing it as parameter in job to a numeric variable.
At that time job is throwing error as ->
"Loop final value not numeric" (cat: count.txt) I am passing out put of UNIX command Cat count.txt where the file count.txt contains the count no.

Thanks in advance
Santosh
betterthanever
Participant
Posts: 152
Joined: Tue Jan 13, 2009 8:59 am

Re: Convert string to numeric value

Post by betterthanever »

I this is happening since u have Filed Marks in the Execute Command output...

when assigning the output to the Job parameter, remove the the FM.

Code: Select all

Convert(@FM,'', Execute_Command_7.$CommandOutput)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What U has ought not to concern srai.

The second person personal pronoun in English is spelled "you", not "u". Please strive for a professional standard of English on DSXchange, because even good English is difficult enough for non-native speakers, and also because DSXchange is not an SMS-enabled device.
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