schema

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
pp
Participant
Posts: 27
Joined: Tue Apr 03, 2007 8:50 pm

schema

Post by pp »

I am trying to run a job which uses fixed length file. I get an error on the filesize/rec length. I am using a record length of 21 and I have also tried 22. How do I get this job to run? Does the schema below look good?

Schema

record
{record_length=fixed, delim=none, quote=none}
(
LName:string[max=10] {width=10};
FName:string[max=10] {width=10};
Initial:string[max=1] {width=1};
)

Data is like(3 records below) :

RAY FITZGERALD HIGGINS MICHAEL ORLOW JANICE H
ccatania
Premium Member
Premium Member
Posts: 68
Joined: Thu Sep 08, 2005 5:42 am
Location: Raleigh
Contact:

Post by ccatania »

If you are unable to view the data from the input source, try a different delimiter setting eg Tab. You may have to try different setting to find the one that works. You mentioned that your source is a flat file. check to see-if you can- what it looks like from where it's created.
Charlie
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Your data do not match your metadata, or the phpBB software has removed your spaces. I assume that you mean your data look like
RAY......FITZGERALD HIGGINS.. MICHAEL.. ORLOW.... JANICE... H

What have you specified as:
record delimiter
field delimiter
record length?

Try record length = fixed
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pp
Participant
Posts: 27
Joined: Tue Apr 03, 2007 8:50 pm

Post by pp »

Yes, that's right. My data looks like:
RAY.......FITZGERALD.HIGGINS...MICHAEL....ORLOW.....JANICE....H

Do you still think my data does not match my schema?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's not what I think that matters. It's what DataStage thinks.

Please review your record level and field level properties carefully - you did not answer my suggestion about record length = fixed, for example.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pp
Participant
Posts: 27
Joined: Tue Apr 03, 2007 8:50 pm

Post by pp »

What suggestion of yours about record length=fixed, did I not answer?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You did not report whether you had tried setting the Record Length property to "Fixed".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pp
Participant
Posts: 27
Joined: Tue Apr 03, 2007 8:50 pm

Post by pp »

Please look at the very first posting. I have record_length set to fixed in my schema.
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post by ds_developer »

It appears that you have a fixed width file with no line termination. Is that what you have set in the stage? In your example, are you using a period "." to designate a space?
RAY.......FITZGERALD.HIGGINS...MICHAEL....ORLOW.....JANICE....H
If that is true then your schema is correct if you are using no line termination. Only you can really look at the file and you should do that with a text editor that can show hex like UltraEdit.

John
pp
Participant
Posts: 27
Joined: Tue Apr 03, 2007 8:50 pm

Post by pp »

Yes, I am using a period to represent a space.
I have no line termination after the last record in my data. And I made sure there were no spaces after the last record.

I am still getting an error and I cannot get this job to run.
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post by ds_developer »

Are you using the Sequential File stage? Please post the error message.

John
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What is the record delimiter property set to? This needs to be "None".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pp
Participant
Posts: 27
Joined: Tue Apr 03, 2007 8:50 pm

Post by pp »

Yes, I am using a sequential stage. And I have tried setting the record delimiter to none.

I get the following error.

Bad record delimiter after fixed-length record: expected "none", got "HIGG"

Either my data is wrong or my schema is and I am having a tough time figuring it out.
FYI: I have checked my data innumerable number of times.
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post by ds_developer »

On 7.5.2, the Format tab of the Sequential File Stage related to the Record Delimiter states:
For fixed-width files with no explicit record delimiter, remove this property altogether.
So instead of None (or blank) as the record delimiter, try removing this property altogether. Please verify that the 3 columns add up to 21.

John
pp
Participant
Posts: 27
Joined: Tue Apr 03, 2007 8:50 pm

Post by pp »

I have also tried removing the record delimiter property altogether.
And I have made sure that my columns are adding up to 21.

Inspite of this I get the same error as "Bad record delimiter after fixed-length record: expected "none", got "HIGG" ".
Post Reply