Schema File Structure

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

jayantthakore
Participant
Posts: 42
Joined: Tue Jan 18, 2005 5:48 am

Schema File Structure

Post 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
regards,
Jayant S Thakore
ashwin141
Participant
Posts: 95
Joined: Wed Aug 24, 2005 2:26 am
Location: London, UK

Post 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
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post 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.
trobinson
Participant
Posts: 208
Joined: Thu Apr 11, 2002 6:02 am
Location: Saint Louis
Contact:

Post 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.
patrickmn10
Participant
Posts: 16
Joined: Fri Apr 28, 2006 1:01 pm

hi

Post 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.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
patrickmn10
Participant
Posts: 16
Joined: Fri Apr 28, 2006 1:01 pm

Hi

Post 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.
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Re: Hi

Post by sud »

Hey,

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

:-)
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
patrickmn10
Participant
Posts: 16
Joined: Fri Apr 28, 2006 1:01 pm

Re: Hi

Post 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.
trobinson
Participant
Posts: 208
Joined: Thu Apr 11, 2002 6:02 am
Location: Saint Louis
Contact:

Post 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.
patrickmn10
Participant
Posts: 16
Joined: Fri Apr 28, 2006 1:01 pm

hi

Post 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)
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Is it possible to post the schema you choosed.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
trobinson
Participant
Posts: 208
Joined: Thu Apr 11, 2002 6:02 am
Location: Saint Louis
Contact:

Post 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?
patrickmn10
Participant
Posts: 16
Joined: Fri Apr 28, 2006 1:01 pm

Post by patrickmn10 »

Even I can't read Ray's Comments, Would somebody explain how to resolve this issue. Appreciate Ur help.
Post Reply