Page 1 of 1

Schema for sequential file

Posted: Fri Jul 08, 2005 9:41 am
by sudarshan
Hi

I am trying to develop a single job which will load data from one sequential file to another without any transformation, while the file names and the schema will be parametrized.

I am using runtime column propagation and have already developed the job (I am not importing metadata ... I am only specifying the schema file).

Now, when I test the job, first i tested with a input and output file with two columns, I am giving the same schema file for both input and output sequential file stage, it works. Here is the schema ...

record
( NAME: nullable string[max=10];
SURNAME: nullable string[max=10];
)


Next I am testing with files which have three columns and i am specifying the following schema

record
( NAME: nullable string[max=10];
SURNAME: nullable string[max=10];
AGE: nullable string[max=10];
)

I am getting the following warnings :

Sequential_File_0,0: Delimiter for field "SURNAME" not found; input: <empty>, at offset: 15
Sequential_File_0,0: Import warning at record 0.
Sequential_File_0,0: Import unsuccessful at record 0.
Sequential_File_0,0: Import complete; 0 records imported successfully, 1 rejected.

The funny thing is that, even with the first job I am getting the same warnings but it is importing and writing records properly whereas here it is rejecting.

Please help me out here !!

Thanks in advance!!

Posted: Fri Jul 08, 2005 11:04 pm
by rasi
Hi

First check your source file whether you have the delimiters set correctly. Next this is to verify the source file Sequential File property and inside click the Format Tab and make sure that you have Null Field Value with some default value or empty string.

Thanks

Posted: Sun Jul 10, 2005 10:42 pm
by sudarshan
rasi wrote:Hi

First check your source file whether you have the delimiters set correctly. Next this is to verify the source file Sequential File property and inside click the Format Tab and make sure that you have Null Field Value with some default value or empty string.

Thanks
Hey I did as per your suggestion, the file format is same ... n I have specified the null charecter as well in Format tab. Same roblem !!

Can someone specify how to write schema for sequential files ? i.e., mentioning delimiters etc. in the schema itself ? :?:

Posted: Mon Jul 11, 2005 12:30 am
by benny.lbs
Hope it is what you wanted.

Code: Select all

record
  {record_delim='\n', delim=',', quote=double, ascii, text, zoned, leading}
(
  Col1:string[40] {delim=',', quote=double};
  Col2:nullable string[3] {null_field='\xFF\xFF\xFF'};
  Col3:nullable decimal[17,0] {zoned, leading};
}
sudarshan wrote:
rasi wrote:Hi

First check your source file whether you have the delimiters set correctly. Next this is to verify the source file Sequential File property and inside click the Format Tab and make sure that you have Null Field Value with some default value or empty string.

Thanks
Hey I did as per your suggestion, the file format is same ... n I have specified the null charecter as well in Format tab. Same roblem !!

Can someone specify how to write schema for sequential files ? i.e., mentioning delimiters etc. in the schema itself ? :?:
[/code]

Posted: Mon Jul 11, 2005 5:55 am
by ray.wurlod
Begin by importing the Sequential File table definition. This will automatically be translated into a schema definition for you.