Unable to load fixed width format 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
siddesai
Participant
Posts: 26
Joined: Thu Apr 26, 2007 11:28 pm

Unable to load fixed width format file

Post by siddesai »

Hey Guys,
I 'm trying to extract a .dat file with fixed with format using a sequential file stage. I have set all the relevant properties including the actual size of all the files. eg. 110 bytes. But, whenever I try to do a view data and I get the below mentioned error.


>##E TOIX 000158 17:14:59(000) <SQ_SourceFile,0> Error reading on import.
>##E TOIX 000050 17:14:59(001) <SQ_SourceFile,0> Bad record delimiter after fixed-length record: expected "\n", got "\r"
>##E TOIX 000179 17:14:59(002) <SQ_SourceFile,0> Import error at record 0.
>##E TOIX 000089 17:14:59(003) <SQ_SourceFile,0> The runLocally() of the operator failed.
##I TOIX 000094 17:14:59(004) <SQ_SourceFile,0> Output 0 produced 0 records.
##I TOIX 000094 17:14:59(005) <SQ_SourceFile,0> Output 1 produced 0 records.

I tried to load all the data using Varchar but the moment I specify "decimal" it throws below mentioned msg
">##E TFIG 000000 17:23:49(002) <SQ_SourceFile> At field "CPI_ID": When validating import/export function: APT_GFIX_Decimal::validateParameters: the decimal "text" format is variable length, and no external length is specified;
>you should possibly specify an appropriate "width" property; external format: {text, padchar=32, nofix_zero, precision=10, scale=0, round=trunc_zero, ascii}.
"

Please guide as to what might be the possible issue.
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

set the final delimiter=none
have you specified length of all fields correctly.
because
you should possibly specify an appropriate "width" property; external format: {text, padchar=32, nofix_zero, precision=10, scale=0, round=trunc_zero, ascii
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

Looks like you have to edit your decimal fileds properly. Double click on the column grid, you will get the properties to edit. In the properties section under the Decimal type, add the field width property and set it to the size of your decimal meta data. If your decimal is length:12 scale:4 then the width will be 16 (12+4).
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The \r indicates that the file originated on a Windows system. Change the record delimiter string to \r\n
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
siddesai
Participant
Posts: 26
Joined: Thu Apr 26, 2007 11:28 pm

Post by siddesai »

ray.wurlod wrote:The \r indicates that the file originated on a Windows system. Change the record delimiter string to \r\n ...
Thanks Ray. It worked!

Could you please elaborate on the cause of error? It should have been pretty straight forward with import of data but it just didn't work.

The extension of the file is .dat meaning a fixed width format. I specified all the fields and metadata was just right. But, it just didn't accept the delimeters.

I guess DataStage is more of play with it and learn how it works thing..
Dinarth Souto Júnior
Participant
Posts: 1
Joined: Tue May 12, 2020 6:45 am
Location: Brasília

Post by Dinarth Souto Júnior »

ray.wurlod wrote:The \r indicates that the file originated on a Windows system. Change the record delimiter string to \r\n ...

Thanks!! It worked for me too!!
Post Reply