You need to use lpad
along with isnull() check.
lpad(IIF(isnull(col2),'',col2),' ',5)
This will pad with 5 spaces if its null and if its not null, then it will simply left pad spaces until col2 length is 5.
Although Koushik's answer will work just fine, in fact you should define your output as a fixed-width file and let Informatica do the job.
Once the target is a fixed-width file with proper pors length definition, Informatica will pad the values for all ports appropriately and there will be no LPAD functions required for any of the output ports.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.