Page 1 of 1

strip BOM in schema file

Posted: Thu Feb 05, 2015 3:46 pm
by hsahay
Hi

I need to know the property one would use in a schema file to set STRIP BOM = true.

I need to do this because the BOM character is ending up in the data and also causing characters to shift 1 position to the right when reading a fixed length file.

I have already tried stripbom=true and strip_bom=true

My schema file is as below

// Fixed width file
record
{record_delim='\n',final_delim=none,delim=none,quote=none,charset='UTF-16LE'}
(
ServiceName:USTRING[40];
ServiceUrl:USTRING[40];
OrigTitle:USTRING[35];
Junk:USTRING[35];
OrigWriter:USTRING[35];
OrigArtist:USTRING[35];
UseType:USTRING[2];
PerfType:USTRING[2];
PerfSttDt:USTRING[8];
Duration:USTRING[4];
Plays:USTRING[9];
)

PS - Does anyone know any place where i can get a full list of all schema file properties ? For example the charset property i am using above, i had to open a ticket with IBM to find that. Earlier i was using nls_lang='UTF-16LE' - that does not work by the way.

Posted: Fri Feb 06, 2015 6:20 pm
by hsahay
Still don't know what property to use in the schema file, but i found a workaround.

Apparently, even though i am using a schema file to define the file metadata, i can still go into the sequential file stage, go to OPTIONS and set STRIP BOM=TRUE.

At run time, any property that is defined both in the stage as well as the schema file is overwritten by the value in the schema file.

But a property that is defined only in the stage, STRIP BOM=true, in this case, retains its value.

So it works.

Posted: Sat Feb 07, 2015 3:28 pm
by ray.wurlod
Why not save the table definition from the Sequential File stage Columns tab, then view the table definition as a record schema on the Layout tab?