Fixed width file

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
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Fixed width file

Post by mydsworld »

I have trying to define a fixed width (length 89) file (each line terminated by DOS line) with the following options :

Record delimiter string = DOS format
Record length = fixed
Final delimiter = end

Field delimiter = none
Field Quote = none

I am getting the following error while trying to view data in a Sequential file.

"record_length=fixed" (no length given) and record field format is variable-length. The first variable-length field is "BILL_TYPE".

Please let me know where to set the field format as fixed.

Thanks
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Post by mydsworld »

I tried with the following :

Record delimiter string = \r\n
Record length = fixed
Final delimiter = none

Field delimiter = none

Then I get the following error :

Bad record delimiter after fixed-length record: expected "\r\n", got " \n"

Please advise.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Looks like a UNIX linefeed delimiter rather than DOS style CR/LF pairs.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

What is the data type of "BILL_TYPE"?

Mike
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

You might need to redefine your fields as CHAR of fixed width.
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

You might need to redefine your fields as CHAR of fixed width.
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Post by mydsworld »

All the fields are CHAR fields only.

Please tell me onething.I have my original Table definition (in the Table Definition\Sequential folder) different than this.Once I load the definition into the Sequential File stage I am making those modification.So, do I need to change the original Table definition with those.
BugFree
Participant
Posts: 82
Joined: Wed Dec 13, 2006 6:02 am

Post by BugFree »

I think you have not mentioned the field length along with the data type as CHAR. For fixed width file, you have to qoute the field length along with data type as CHAR.
I believe the warning is not because of the original table definition.
Ping me if I am wrong...
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Post by mydsworld »

The field lengths are all there in the definition.BILL_TYPE is of CHAR(4).Similarly I have all other CHAR fields with some lengths.
kandyshandy
Participant
Posts: 597
Joined: Fri Apr 29, 2005 6:19 am
Location: Singapore

Post by kandyshandy »

You said you are trying to view the data in a sequential file. Can you please let us know whether the file was created by datastage or manually?
Kandy
_________________
Try and Try again…You will succeed atlast!!
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Post by mydsworld »

The file was created by some Legacy system and ftped to Datastage server.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Have you imported the metadata (table definition) for this file into DataStage so that you can specify the column widths and the fact that it is a fixed width file from the outset?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
krisna
Participant
Posts: 77
Joined: Tue Apr 08, 2008 11:33 pm

Post by krisna »

Please provide sample data.
Post Reply