record delimiter problems

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
psriva
Participant
Posts: 44
Joined: Fri Aug 11, 2006 8:40 am

record delimiter problems

Post by psriva »

I have a variable length file and I am using a parallel reader as an input stage for the variable length file. It is a must to specify the record delimiter within this stage.
Now I do not have a record delimiter as none of the records have a newline at the end of the record. What should my record delimiter be as I have tried null and none. I am out of ideas. Please help me.
ps
samsuf2002
Premium Member
Premium Member
Posts: 397
Joined: Wed Apr 12, 2006 2:28 pm
Location: Tennesse

Post by samsuf2002 »

MAY BE U SHOULD TRY FIXED WIDTH OPTION
hi sam here
shaimil
Charter Member
Charter Member
Posts: 37
Joined: Fri Feb 28, 2003 5:37 am
Location: UK

Post by shaimil »

What is the file type?

Do you mean it has a variable record lengths within the same file?

Shai
rwierdsm
Premium Member
Premium Member
Posts: 209
Joined: Fri Jan 09, 2004 1:14 pm
Location: Toronto, Canada
Contact:

Re: record delimiter problems

Post by rwierdsm »

psriva wrote:Now I do not have a record delimiter as none of the records have a newline at the end of the record. What should my record delimiter be as I have tried null and none. I am out of ideas. Please help me.
What character(s) are used to distinguish the different records in your file? I.e. when you open your file with a text editor, how do you know when the first record ends and the second one starts?

Rob W
Rob Wierdsma
Toronto, Canada
bartonbishop.com
psriva
Participant
Posts: 44
Joined: Fri Aug 11, 2006 8:40 am

Post by psriva »

Pipe delimited.

Now when I specify the record delimiter as pipe (|), I get another error on one of the field saying " Delimiter for field 'name' not found".

Th following is my record schema:

record
{final_delim=none,delim='|',charset='ISO8859-1'}
(
account:string[max=10] {default='0'};
name:string[max=10] {default='a'};
location:string[max=10] ;
)

And below is the data file:

104246|abc|usa|104247|def|uk|104250|ghi|india|

Please help me write the right schema for this.
ps
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Code: Select all

104246|abc|usa|104247|def|uk|104250|ghi|india| 
If you look at the data and if it is a complete record that you have provided, then you need to set your Final Delimiter as "|"(pipe) which is obvious from the record.
Kris

Where's the "Any" key?-Homer Simpson
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

psriva wrote:Pipe delimited.

Now when I specify the record delimiter as pipe (|), I get another error on one of the field saying " Delimiter for field 'name' not found".

Th following is my record schema:

record
{final_delim=none,delim='|',charset='ISO8859-1'}
(
account:string[max=10] {default='0'};
name:string[max=10] {default='a'};
location:string[max=10] ;
)

And below is the data file:

104246|abc|usa|104246|abc|usa|104246|abc|usa|

Please help me write the right schema for this.
This data has '|' both as field delimiter and record delimiter. Can you try and correct the data? change record delimiter to a line termination character after location. something like:
104246|abc|usa
104246|abc|usa

You cannot read the data in the esixting format.
104246|abc|usa
psriva
Participant
Posts: 44
Joined: Fri Aug 11, 2006 8:40 am

Post by psriva »

I tried the same schema with sequential file stage and it runs fine.
ps
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

What was the stage you were using earlier? :?
Kris

Where's the "Any" key?-Homer Simpson
psriva
Participant
Posts: 44
Joined: Fri Aug 11, 2006 8:40 am

Post by psriva »

I am using the parallel reader stage currently.
ps
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is no such thing as the "parallel reader" stage. I presume that you are using a Sequential File stage.

If your data have no line terminators then each row must be of the same length or of a known length described in the data. Otherwise there is no way that any utility can accurately read the data.

Have you tried setting the Final Delimiter property (not the same as the Record Delimiter property)?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
psriva
Participant
Posts: 44
Joined: Fri Aug 11, 2006 8:40 am

Post by psriva »

I am using a custom stage developed for use within my company.
ps
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That was vital information omitted from your original post. I can only suggest close scrutiny of that stage's source code to determine how records of this type ought to be handled.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply