how to create schema files

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
mouthou
Participant
Posts: 208
Joined: Sun Jul 04, 2004 11:57 pm

how to create schema files

Post by mouthou »

For a requirement with source files having dynamic metadata, I wanted to go with schema file approach.

I tried searching the forum to know how to create schema files to process sources files with dynamic metadata. Sorry I couldnt find anything to clarify that. As per one of the old threads, I tried creating a table, imported metadata in the repository etc. But when checked the Table definitions to create the schema file, I couldnt find any option.

Appreciate if you can show some options to create a schema file or reference links in this forum.

Thanks
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Open table metadata in developer and click on parallel radio button.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Create and compile your parallel job. Open the generated OSH and copy the relevant schema from there before pasting into a file. Name the file with a ".osh" suffix.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

priyadarshikunal wrote:Open table metadata in developer and click on parallel radio button.
Right click and choose Save As... to create the schema file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mouthou
Participant
Posts: 208
Joined: Sun Jul 04, 2004 11:57 pm

Post by mouthou »

Thanks . I couldn't get your option. Metadata developer? I checked it while importing the metadata from Table defn, assuming you meant that. Also checked opening the imported metadata after import. Couldnt find any option closer. I seem to miss something here.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

DataStage Developer
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
mouthou
Participant
Posts: 208
Joined: Sun Jul 04, 2004 11:57 pm

Post by mouthou »

Thanks. I could understand & try only half of your option. I created a simple job with sequential file and a peek. There is no generated OSH seen anywhere, rather I copied the schema definitions from the run log as pasted below. not sure of the allowed lines to pick to create a schema file as such. i guess i could pick 1-6.

But I couldnt understand how to create a file object in Designer unlike jobs/sequencers are created. I seem to miss something with this step. I hope you can point me with bit more details

Code: Select all

main_program: Echo:
import
-schema record
  {final_delim=end, delim='|', quote=none}
(
  col1:nullable string[max=3];
  col2:nullable string[max=2];
)
-rejects continue
-reportProgress yes
-firstLineColumnNames
-file  '/home/myid/tempdir/test.txt'
[ident('Sequential_File_0'); jobmon_ident('Sequential_File_0')]
0> [] 'Sequential_File_0:DSLink2.v'
;
peek
-nrecs 10
-name
[ident('Peek_3'); jobmon_ident('Peek_3')]
0< [] 'Sequential_File_0:DSLink2.v'
atul9806
Participant
Posts: 96
Joined: Tue Mar 06, 2012 6:12 am
Location: Pune
Contact:

Post by atul9806 »

For display the OSH in datastage job log, we need to set TRUE to this environment variable OSH_ECHO. You can set it in Admin client or Developer client.

Now, coming to your question -
It will be so much manual work but will work for sure -
1. Save the metadata from any stage column definition which you required. Save as -> select a location ->give a proper name
2. Now, go to that location, double click on the table def, when opened, click on parallel radio button. It will display the Schema definition
Now, you can copy the def from here and paste it in a flat file

Hope this help!
~Atul Singh
<a href=http://www.datagenx.net>DataGenX</a> | <a href=https://www.linkedin.com/in/atulsinghds>LinkedIn</a>
Post Reply