Hi,
I am having a schema file. It contains 5 fields. Input files what I am having are sometimes 5 fields and sometimes only 4 fields are there.
In this case Is there any way to parse one field with a default value in the schema file.
Thanks
Kavuri
Schema file default values
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You can provide a default value for every field.
To learn how, create a table definition using the GUI, with default value(s), then go to the Layout tab and look at its record schema. That's what you need to do in your schema file.
To learn how, create a table definition using the GUI, with default value(s), then go to the Layout tab and look at its record schema. That's what you need to do in your 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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 612
- Joined: Thu May 03, 2007 4:59 am
- Location: Melbourne
Ex:
record
(
TEST_COLUMN:string[2] {default='AB'};
)
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
It depends upon the method you use to frame the Schema file. If you have any coding mechanism which actually read the file and create the Schema File? If so handle the defaults adding up in the same.
Or be more specific up on ur question.
Or be more specific up on ur question.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
I am using partial schema, something like below.
record{ intact=details, record_delim_string='\n'}
(
Store:string[1] {delim=none};
Store_ID: string[5] {delim=none};
Day: string[10] {delim=none};
Trans_Count: string[5] {delim=none};
DOL: string[] {delim=none};
)
In the input file I wont get first field sometimes. Currently I am appending a character in the shell script and calling the datastage job. i am passing the above schema file in the sequential file stage options schema file.
I am not at all using column names in the sequential file stage. When I pass this to copy stage then in the output of copy stage I am defining my column names.
In the above schema as i am not using all 5 fields always, I want to use some default value for the first filed.
Can you suggest a way for this?
Thanks
Kavuri
record{ intact=details, record_delim_string='\n'}
(
Store:string[1] {delim=none};
Store_ID: string[5] {delim=none};
Day: string[10] {delim=none};
Trans_Count: string[5] {delim=none};
DOL: string[] {delim=none};
)
In the input file I wont get first field sometimes. Currently I am appending a character in the shell script and calling the datastage job. i am passing the above schema file in the sequential file stage options schema file.
I am not at all using column names in the sequential file stage. When I pass this to copy stage then in the output of copy stage I am defining my column names.
In the above schema as i am not using all 5 fields always, I want to use some default value for the first filed.
Can you suggest a way for this?
Thanks
Kavuri