Substr issue

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
dubuku_01
Participant
Posts: 79
Joined: Fri Nov 18, 2011 2:18 pm
Location: chennai

Substr issue

Post by dubuku_01 »

Hi all,

My input column contains year,month and week value like 2011014. Where first 4 characters correspond to the year and second 2 characters correspond to month and the seventh character correspond to the week.

In transformer, am using function like this to extract month value.

year_month_week_id[5,2] and am getting value as 1. But i want the value to be 01. I changed the scale in the transformer to be 2. But still the same issue.
Anyone please throw some light on this.


Thanks in advance,
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Target needs to be a string if you want to preserve the leading zero.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sathishmca
Participant
Posts: 43
Joined: Mon Mar 03, 2008 10:58 pm
Location: Chennai

Re: Substr issue

Post by sathishmca »

What is your target ?

just try with Varchar target field.
Post Reply