Converting Number To String

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
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Converting Number To String

Post by somu_june »

Hi,

I need a help to over come warning message. I have a job when Iam running that job Iam getting a warning message

Surr_Key_Ann: When checking operator: When binding output interface field "AnnNumber" to field "AnnNumber": Implicit conversion from source type "int32" to result type "string[max=18]": Converting number to string.

what Iam doing in my job is Iam using a surrogate key stage to generate a key AnnNumber 32 bit integer and outputs AnnNumber to transformer stage input and converting to format like 'DMT':Annnumber to a varchar [18] so I am getting output like 'DMT1' from transformer.

can I use Modify stage to over come this problem. If I can use that Can any one tell me how to use modify stage.


Thanks,
Srinu
somaraju
kcshankar
Charter Member
Charter Member
Posts: 91
Joined: Mon Jan 10, 2005 2:06 am

Post by kcshankar »

Hi somu_june,
When the target columns metadata does not match with the source's(In your case source "int32" to target "string[max=18]")and no explicit conversion has been made you will get this warning message.
DS does the number to string conversion and warns.
Try by changing your source data type as String and check.

regards
kcs
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Have you looked at the chapter on the Modify stage in the Parallel Job Developer's Guide? Only beware that it has the wrong function for handling null (which won't affect your current issue).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Hi Srinu,

You have assinged the data type of AnnNumber in surrogate key as Varchar(18).
Rather assign it as integer and map it to varchar. Surrogate key can produce only the integer number. int32 can be implicitly convert to varchar in transformer. you can assign the expressio as 'DMT':Link.Annnumber which is ok to get it converted.

-Kumar
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post by somu_june »

Hi Kumar,


Thanks for your help in solving my problem.








Thanks,
somaraju
somaraju
Post Reply