Page 1 of 1

how to create fixed width text file

Posted: Mon Aug 08, 2011 3:09 pm
by developeretl
Hi ,
I need to create fixed width text file in the target. From source im getting csv file. From source data is in varchar and in target they are in char type. I want to have fixed width file in the target directory. If the length is 10 and data is of length 5 then it should add 5 zero's or add space to make it length 10. For numeric type when I have applied the logic it is working out ie....changing the target sql type to char. But it im not seeing this true for char type. Can anyone please tell me how to achieve this ?

Example: target lenth 10
Source : "1234"
Target : " 0000001234"

Posted: Mon Aug 08, 2011 3:47 pm
by chulett
As I'm assuming this has nothing to do with ProfileStage or IA, please repost this in the proper forum - the Enterprise Edition forum.

Re: how to create fixed width text file

Posted: Sat Oct 22, 2011 1:53 am
by ramsnaraboina
Hi from my Analysis Info Analyzer, we dont achive these situation

Posted: Sat Oct 22, 2011 10:04 am
by ray.wurlod
With Information Analyzer you get the reports it gives you. You can use DataStage subsequently if you don't like the format.

Posted: Sun Oct 23, 2011 9:41 pm
by deeplind07
you can use LPAD funciton to pad leading zeroes by mentioning the target length.(dont forget to add trim function for the input column)

Posted: Sun Oct 23, 2011 10:57 pm
by ray.wurlod
deeplind07 wrote:you can use LPAD funciton to pad leading zeroes by mentioning the target length.(dont forget to add trim function for the input column)
In Information Analyzer? Where?

Posted: Sun Oct 23, 2011 11:35 pm
by deeplind07
I am sorry i was talking about trasforemer stage..

Posted: Mon Oct 24, 2011 12:29 am
by pandeesh
deeplind07 wrote:I am sorry i was talking about trasforemer stage..
What about Right() or Left()?

Posted: Mon Oct 24, 2011 7:08 am
by ray.wurlod
There is no Transformer stage in Information Analyzer. I repeat that the requirement must be solved by post-processing the Information Analyzer report using a DataStage job.