Reading a Sequential File
Moderators: chulett, rschirm, roy
Reading a Sequential File
Hi All,
Well have this job where in i'm using the seq output file of a server job as my input to the parallel job .
well this file has about 28 fields of which most of them are of type char and few of type integer , smallInt etc
and they are of fixed width format .
now i'm having a problem reading this file in parallel job . i have given the format Record Length fixed and delimiter as none.
but still its not able to open the file . the error it displays is as
>##E TOIX 000000 14:34:38(005) <Sequential_File_0> "record_length=fixed" (no length given) and record field format is variable-length. The first variable-length field is "TOTAL_CPW_VOL".
>##E TFSR 000019 14:34:38(009) <main_program> Could not check all operators because of previous error(s)
well i tried chaging the datatypes to varchar too , but still same problem appaers
How do i fix this problem ?
Thanks in advance
Well have this job where in i'm using the seq output file of a server job as my input to the parallel job .
well this file has about 28 fields of which most of them are of type char and few of type integer , smallInt etc
and they are of fixed width format .
now i'm having a problem reading this file in parallel job . i have given the format Record Length fixed and delimiter as none.
but still its not able to open the file . the error it displays is as
>##E TOIX 000000 14:34:38(005) <Sequential_File_0> "record_length=fixed" (no length given) and record field format is variable-length. The first variable-length field is "TOTAL_CPW_VOL".
>##E TFSR 000019 14:34:38(009) <main_program> Could not check all operators because of previous error(s)
well i tried chaging the datatypes to varchar too , but still same problem appaers
How do i fix this problem ?
Thanks in advance
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
Your error says it very clearly. You have specified some columns with variable-length datatypes such as varchar and integer. An integer is variable length because the number that might be there in a cell is smaller than the width mentioned. As a result, actual size will be smaller.
Change everything to char and fixed-width and it'll take care of the problem. In PX, in sequentiall file stage, there does not seem to be a way to pick a variable length record exclusively other than specifying variable length field types such as varchar.
Change everything to char and fixed-width and it'll take care of the problem. In PX, in sequentiall file stage, there does not seem to be a way to pick a variable length record exclusively other than specifying variable length field types such as varchar.
Well i have kept all fields as char itself and few fields which were dates as dates only and few which were smallint as smallint itself.
i went and created the job were in the flow goes this way
from seqfile>>>>>transformer>>>>>>seq file
i just did a simple job to use how it works
well the job aborted and the fatal error it throws are
Sequential_File_0: Unable to initialize importer.
Sequential_File_0: "record_length=fixed" (no length given) and record field format is variable-length. The first variable-length field is "MAX_PROMO_PER_WK".
Sequential_File_3: Error when checking operator: Unable to initialize the exporter.
Sequential_File_3: Error when checking operator: "record_length=fixed" (no length given) and record field format is variable-length. The first variable-length field is "MAX_PROMO_PER_WK".
main_program: Could not check all operators because of previous error(s)
whatt does the first fatal error mean?
Can somebody help me resolve this issue
Thanks in advance
i went and created the job were in the flow goes this way
from seqfile>>>>>transformer>>>>>>seq file
i just did a simple job to use how it works
well the job aborted and the fatal error it throws are
Sequential_File_0: Unable to initialize importer.
Sequential_File_0: "record_length=fixed" (no length given) and record field format is variable-length. The first variable-length field is "MAX_PROMO_PER_WK".
Sequential_File_3: Error when checking operator: Unable to initialize the exporter.
Sequential_File_3: Error when checking operator: "record_length=fixed" (no length given) and record field format is variable-length. The first variable-length field is "MAX_PROMO_PER_WK".
main_program: Could not check all operators because of previous error(s)
whatt does the first fatal error mean?
Can somebody help me resolve this issue
Thanks in advance
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
I guess the field "MAX_PROMO_PER_WK" is smallint and it is having a length less than 5(which is the maximum length for smallint). Either you need to pad that field by editing the field properties (In output sequential file) or change all the fields to char of fixed length.
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
Thomas Alva Edison(1847-1931)
-
- Participant
- Posts: 73
- Joined: Tue May 10, 2005 6:21 pm
- Location: Sydney
You will need to set up an additional property for variable-length fields for fixed-width files.
Double click each column in the Column page of the sequencial file stage and in the popup window Edit Column Meta Data set the Field Width property for each of the fields. It should work for all data types.
Double click each column in the Column page of the sequencial file stage and in the popup window Edit Column Meta Data set the Field Width property for each of the fields. It should work for all data types.
sshettar wrote:Well my record Delimiter is Unix newline and Field delimiter is none . But still doesnt work.
Where else do you think i'm goin wrong ?
Edward Yuan