I have a requirement of reading from fixed length file(Length 30) -
spaces are coming from source for less length and NULL field.
sample file -
$ cat poctest.txt
seq# Name marks per grd
000001Ram 000098098.00A+
000002Sham 000078078.00B+
000003Sumit 000068068.00B
000000 000000000.00
I read it through sequential file -
seq# - varchar(6)
Name - Varchar(10)
marks - varchar(6)
per - varchar(6)
grd - varchar(2)
by specifying delimiter as 'none' and final delimiter as 'end' and read it through 5 different columns and I am able to read file in 5 different columns. Now, I want to have same file format with a delimiter '|' to be propogated to another sequential file.
My Design -
Seq File Stage --> Copy Stage --> Seq File Stage
this design is giving me same structure of file as of source (i.e, without delimiter).
Can anyone please tell how this can be done.
P.S. - Is there anything specific need to be defined in DS to make it understand that source file is fixed length.
Reading from fixed length file
Moderators: chulett, rschirm, roy
Reading from fixed length file
Gaurav Martha
Thanks Abhi, I already did that.. though while doing more R&D..This issue is narrowed down to what you can say precedential order of DS properties..
while reading it I mentioned start position at column level for each column and same column was propogated thoughout jobs
SEQ file --> Copy Stage --> SEQ file1,
at SEQ file1 I did defined delimiter as '|' , though the same start position was propogated from SEQ file till SEQ file1 resulting in overwrite of properties and I was getting same result as that of source file.
Anyways Thank you for your inputs.
while reading it I mentioned start position at column level for each column and same column was propogated thoughout jobs
SEQ file --> Copy Stage --> SEQ file1,
at SEQ file1 I did defined delimiter as '|' , though the same start position was propogated from SEQ file till SEQ file1 resulting in overwrite of properties and I was getting same result as that of source file.
Anyways Thank you for your inputs.
Gaurav Martha
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Hi Ray,
Thank you for the reply, your approach is good , Having said that just wanted to make a quick point, It was sample data, just wanted to have POC that fixed length file can be read through sequential file in different columns.
As mentioned in earlier post while doing so, when same seq file propogated throughout the job and same start position for all columns also propogated throuout which was not letting "|" delimiter to do its work. As I removed start position at column level properties for all columns I was able to see delimited data, this can be resolved.
Thank you for the reply, your approach is good , Having said that just wanted to make a quick point, It was sample data, just wanted to have POC that fixed length file can be read through sequential file in different columns.
As mentioned in earlier post while doing so, when same seq file propogated throughout the job and same start position for all columns also propogated throuout which was not letting "|" delimiter to do its work. As I removed start position at column level properties for all columns I was able to see delimited data, this can be resolved.
Gaurav Martha