Convert Integer to Varchar datatype

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
krystlecsy
Participant
Posts: 50
Joined: Wed Jul 14, 2004 7:56 am

Convert Integer to Varchar datatype

Post by krystlecsy »

Hi all,

I am trying to convert a integer datatype into varchar datatype using the Modify stage to prevent the warnings to appear in the Director Logs but after using the statement 'lookup_ustring_from_int32', the job immediately stopped due to severe error.

Below are the error logs I encountered with this syntax.

1st time
main_program: Error parsing modify adapter: Error in binding: Unknown conversion: lookup_ustring_from_int32
Expected destination field selector, got: ")"; input:
cust_numb:string=lookup_ustring_from_int32(cust_numb)
;
subr_numb = subr_numb
;
artm_type = artm_type
;
blpd_code = blpd_code
;

2nd time
main_program: Error parsing modify adapter: Expected ';' or end, got: "cust_numb"; input:
cust_numb:string=lookup_ustring_from_int32 cust_numb
;
subr_numb = subr_numb
;
artm_type = artm_type
;
blpd_code = blpd_code
;

Does anyone know what is the proper syntax for this? :(
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Show us what you want to do and the Modify stage specification that you used to try to achieve it.
You need the lookup table as part of the specification. For example:

Code: Select all

lookup_ustring_from_int32[{defaultstring="unknown"}(1=Cust1;2=Cust2;3=Cust3)](cust_numb)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
krystlecsy
Participant
Posts: 50
Joined: Wed Jul 14, 2004 7:56 am

Post by krystlecsy »

Basically, I want to get rid of warnings like below:-

mdf_DropColumn_ICIR_GO_INTER: When checking operator: When binding output schema variable "outRec": When binding output interface field "key_subr_ir" to field "key_subr": Implicit conversion from source type "string" to result type "string[max=20]": Possible truncation of variable length string.

xfm_InsertCount: When checking operator: When binding input interface field "md_durn" to field "md_durn": Implicit conversion from source type "string[max=10]" to result type "int32": Converting string to number.

Even by doing a type conversion in the Modify stage, these warnings still appear in the Director Log. Any proper ways of doing it? :(
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

When you do an explicit conversion, i.e. "StringToDecimal" the implicit conversion warning will not appear. If you are 100% certain that your implicit conversion are correct you can always deprecate the warning message using the Director log entries and either turn them to informational (recommended) or drop them altogether.
Post Reply