changing format

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
arnie_nits
Participant
Posts: 101
Joined: Mon Aug 13, 2007 2:32 am

changing format

Post by arnie_nits »

Hi I have a requirement where
A1 will become A001
A13 will become A013

Please suggest how to get this.

Regards,
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

If you always have only one alphabet and followed by any number of digits then try this

Code: Select all

svAlpha=input_field[1,1]
svNum=input_field[2]
target_field=svAlpha : right('000':svNum,3)
You are the creator of your destiny - Swami Vivekananda
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

NewColumn = in.Field[1,1]:FMT(In.Field[2,99],"3'0'R")
arnie_nits
Participant
Posts: 101
Joined: Mon Aug 13, 2007 2:32 am

Post by arnie_nits »

Thanks...it works....

Regards,
Arnie.
Post Reply