Page 1 of 2

Schema File Structure

Posted: Fri Jun 02, 2006 6:18 am
by jayantthakore
Hi,
Can anyone give me a Schema File Templete which is used in the Sequential file Stage .Please give a exaple of what type of file is there.
Is it a csv file or what & where to store that file.

cheers,
Jayant

Posted: Fri Jun 02, 2006 7:00 am
by ashwin141
In sequential file stage, check Options you can find Schema file. You can give the path and name of the file which holds the schema.
Example is

record (
empname:string[255];
address1:nullable string[255];
address2:nullable string[255];
deptno:int32
)


Hope it helps.

Regards
Ashwin

Posted: Fri Jun 02, 2006 8:08 am
by bcarlson
You could also export a job that does an import. The resulting DSX file contains a generated schema file. Just open the file in an editor and search for import or schema.

Brad.

Posted: Fri Jun 02, 2006 10:24 am
by trobinson
Or save the Sequential file column definition to a table definition and edit it. Go to the Parallel tab and select the schema file radio button and it will be generated for you.

hi

Posted: Wed Jun 07, 2006 1:42 pm
by patrickmn10
Could you please explain how Schema file to be used. I know we can go table defnitions , layout tab , select parallel option. if i copy the schema and pasted into an editor. then How to use this file into datastage ?. If i have several sequential files which want to load to Oracle database. How Schema file helps , how to use. Do i need to give any specific name to the editted file (schema file). Please explain, if possible with an example. Appreicate Ur time.

Posted: Wed Jun 07, 2006 2:06 pm
by DSguru2B
The name of the file will have an extension of ".rs" meaning Record Schema. This file can be in your folder and can be referred to by the Seq File stage you are using.
There are options to select the schema file name, and its path.

Hi

Posted: Wed Jun 07, 2006 2:56 pm
by patrickmn10
Thanks for the reply, Still I am not getting with your answer. Can you elaborate your answer. When should use schema file, how to use. I have seen few forumns on this, i was not able. With what file name I need to save and import. Can you be breif about this. Thanks again.

Re: Hi

Posted: Wed Jun 07, 2006 3:06 pm
by sud
Hey,

Please go through the appendix in the Parallel Job Developer's Guide. Also, see the chapter on Sequential Files.

:-)

Re: Hi

Posted: Wed Jun 07, 2006 3:19 pm
by patrickmn10
I read that, but still i am not clear with my requirement, where I need to load several different format sequential files to Oracle database. Somebody recommended to schema file. Can you let me know how to use this functionality.

Posted: Wed Jun 07, 2006 5:16 pm
by trobinson
In the Sequential file properties tab is an option for a schema file. This defines the fields and other formatting of the sequential file. You might try paramterizing the schema file property of the Sequential file so that you can use different schema files run through the same job. Using a schema file is straight forward although it has many pitfalls. If you are having difficulties understanding its use then I suggest you don't.

hi

Posted: Wed Jun 07, 2006 9:32 pm
by patrickmn10
Thanks for the reply, I was able to create using schema file, for testing purpose i used sequential file as source and target. when I am loading emp data to the target sequential file using schema file,I am getting following errors, i tried to null value , can you help on this error.

Sequential_File_1: When checking operator: When validating export schema: At field "HIREDATE": "null_field" length (1) must match field's fixed width (19)

Sequential_File_1: When checking operator: When validating export schema: At field "SAL": "null_field" length (1) must match field's fixed width (9)

Posted: Wed Jun 07, 2006 10:01 pm
by kumar_s
Is it possible to post the schema you choosed.

Posted: Wed Jun 07, 2006 11:25 pm
by ray.wurlod
This is nothing to do with the use of a schema file or otherwise. What it has to do with is the value you have given to the "Null Field Length" property. When you specify fixed-width format, then the "Null Field Length" (or the "Null Field Value" if you use that) must exactly correspond to the declared width of the nullable field in question.

Posted: Thu Jun 08, 2006 5:37 am
by trobinson
I can't read Ray's long winded response and by long winded I mean over two lines. Did he tell you to define this:

APT_IMPEXP_ALLOW_ZERO_LENGTH_FIXED_NULL
Value - true

as a Project variable in Administrator?

Posted: Thu Jun 08, 2006 7:07 am
by patrickmn10
Even I can't read Ray's Comments, Would somebody explain how to resolve this issue. Appreciate Ur help.