how to create fixed width text file
-
- Participant
- Posts: 89
- Joined: Sat Jul 24, 2010 11:33 pm
how to create fixed width text file
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"
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"
-
- Participant
- Posts: 10
- Joined: Wed Jan 26, 2011 8:09 am
- Location: Hyderbad
Re: how to create fixed width text file
Hi from my Analysis Info Analyzer, we dont achive these situation
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 31
- Joined: Mon Jun 28, 2010 5:15 am
- Location: pune
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
In Information Analyzer? Where?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)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 31
- Joined: Mon Jun 28, 2010 5:15 am
- Location: pune
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.