Page 1 of 1

modify

Posted: Tue Jul 01, 2008 10:20 pm
by ramesh_inform
smallint to string conversion in modify stage

Will the modify stage implicitly converts smallint to string ?or do we need to manually do it?

i dont find any smallint to string conversion function in parallel job developer's guide

Posted: Wed Jul 02, 2008 12:11 am
by keshav0307
did you try, if modify stage implicitly converts smallint to string ?

have you created any job for it?

Posted: Wed Jul 02, 2008 3:18 am
by balajisr
It does default conversion.

Your specification should be of the following format:

output_column=input_column

Posted: Wed Jul 02, 2008 7:26 am
by keshav0307
It does default conversion.
somehow it is not doing for me. i just tried reading a sequential file with a integer column---modify----dataset,

in dataset i defined the column as varchar, but when i see the metadata of the dataset in dataset management, it is still integer.

Posted: Wed Jul 02, 2008 4:23 pm
by ray.wurlod
Delete the Data Set from Data Set Management utility then re-run the job. Do the same results obtain?

Posted: Wed Jul 02, 2008 9:30 pm
by ramesh_inform
i created a sample job

DB2--->modify------>sort------->DB2


i used the following transformation
REMARK_OCCR_NR : nullable string[5] = REMARK_OCCR_NR

job ran but with following warnings
modify: When checking operator: When binding output schema variable "outRec": When binding output interface field "REMARK_OCCR_NR" to field "REMARK_OCCR_NR": Implicit conversion from source type "int16" to result type "string[5]": Converting number to string. [api/interface_rep.C:6248]

Posted: Thu Jul 03, 2008 12:36 am
by ray.wurlod
So you learn that it DOES do implicit conversion in this case.

Posted: Thu Jul 03, 2008 4:49 am
by ramesh_inform
yes
how to remove the warning?

Posted: Thu Jul 03, 2008 4:51 am
by OddJob
The warning is DataStage saying...
'Look, it's implicit this conversion, please don't tell me how to do my job'

All you need for the Modify Specification is:
KEEP REMARK_OCCR_NR

The input is of type SmallInt (Int16), just set your output type to char[5] nullable.

I suspect you could do this in a copy stage if you don't have any explicit conversion requirements.

Posted: Thu Jul 03, 2008 5:30 am
by ramesh_inform
oddjob,


yes i did the same
but iam getting junk values in the output

Posted: Thu Jul 03, 2008 7:34 am
by OddJob
What 'junk' values do you get? Please give details of the input and output you're getting, along with details of input / out types and modify spec etc.

In my test job I had no issues (no consolation to you though, sorry).