how to create schema files
Moderators: chulett, rschirm, roy
how to create schema files
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
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
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
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
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'
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!
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>
<a href=http://www.datagenx.net>DataGenX</a> | <a href=https://www.linkedin.com/in/atulsinghds>LinkedIn</a>