Schema for sequential 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
sudarshan
Participant
Posts: 11
Joined: Fri Jun 17, 2005 7:41 am

Schema for sequential file

Post 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!!
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post 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
Regards
Siva

Listening to the Learned

"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
sudarshan
Participant
Posts: 11
Joined: Fri Jun 17, 2005 7:41 am

Post 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 ? :?:
benny.lbs
Participant
Posts: 125
Joined: Wed Feb 23, 2005 3:46 am

Post 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]
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Begin by importing the Sequential File table definition. This will automatically be translated into a schema definition for you.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply