Schema file

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
GJ_Stage
Participant
Posts: 131
Joined: Mon Oct 27, 2008 6:59 am

Schema file

Post by GJ_Stage »

Hi ,

In my input file contains only emp_id and emp_firstname and there is no value for emp_lastname.

Input file as:
12345James

But I need to create ds with emp_id , emp_firstname with value and emp_lastname with null value.

schema file contains :

record
{record_delim='n', record_length=fixed, delim=none}
(
emp_id: decimal[5,0] {width=5};
emp_firstname:nullable string[5] {width=5, null_file=' '};
emp_lastname:nullable string[5] {width=5, null_field=' '};
)

But it is not working .Please help me how to make schema file to handle in this case.

Thanks.
Jothi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Define "not working".
-craig

"You can never have too many knives" -- Logan Nine Fingers
GJ_Stage
Participant
Posts: 131
Joined: Mon Oct 27, 2008 6:59 am

Post by GJ_Stage »

Schema what I provided is giving error message:

record
{record_delim='n', record_length=fixed, delim=none}
(
emp_id: decimal[5,0] {width=5};
emp_firstname:nullable string[5] {width=5, null_file=' '};
emp_lastname:nullable string[5] {width=5, null_field=' '};
)

Otherwise , Please help me how to acheive in this case.
Jothi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I'm trying to help you help us and all you've done is repeat yourself. Have you considered the fact that perhaps posting the actual error message you are receiving might help?
-craig

"You can never have too many knives" -- Logan Nine Fingers
GJ_Stage
Participant
Posts: 131
Joined: Mon Oct 27, 2008 6:59 am

Post by GJ_Stage »

Thanks a lot Chulett.

At present I don't have datastage access. What I am trying to ask is

If I write schemafile like below , then first 5 digits assign to emp_id an next first characters will assign to emp_firstname. Is that correct?

emp_id: decimal[5,0] {width=5};
emp_firstname:nullable string[5] {width=5, null_file=' '};
emp_lastname:nullable string[5] {width=5, null_field=' '};

In this case, I wanted to assign first 5 digits to emp_id and then next first characters to emp_lastname not emp_firstname. But I want to keep this firstname in my ds as null. I don't know which option I need to use (I tried skip option and fill option) but no use.

Hope you understood.
Jothi
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The value that represents null must have five characters if the data type is string[5].
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
GJ_Stage
Participant
Posts: 131
Joined: Mon Oct 27, 2008 6:59 am

Post by GJ_Stage »

Thanks Ray.

Please tell me the syntex or which keyword i suppose to use to make read this field as null, because my inputfile does not contains emp_firstname value.

Thanks again for helping.
Jothi
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can't read something that doesn't exist. But you can use, say, a Column Generator stage to create the additional field (and re-map the other).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
GJ_Stage
Participant
Posts: 131
Joined: Mon Oct 27, 2008 6:59 am

Post by GJ_Stage »

Thanks a Lot Ray.
Jothi
Post Reply