Hello
I have a requirement where i need to read the first record of the input File and parse each and every field and need to map to the target.target being database.The file is semicoln demilited and and every field is enclosed in quotes. This job we are planning to make as common job so even other datastage jobs can use this as a first job.
the problem is our first record can have variable no of fields
since this is a common job we are going to recieve files with different layouts for the first record in the input file.
i.e File1 can have 6 fields in the input file
File2 can have 9 fields in the input file
just wondering how to make this job as common even if the file layout vhanges for the first record of the input file.
I have tried by creating a schema file and enabling runtime col propagation. but since the no of fields are dynamic (just wondering how to create a schema file.
Schema File usage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
hello ray
thanks for the reply. but how can i make the job common. if i use file 1 and corresponding schema file then i need to map 6 fields to the target and if i use file 2 and the corresponding schema file then i need to map 9 fields.
can this be achieved. i tried this option but didnt work.
Thanks
thanks for the reply. but how can i make the job common. if i use file 1 and corresponding schema file then i need to map 6 fields to the target and if i use file 2 and the corresponding schema file then i need to map 9 fields.
can this be achieved. i tried this option but didnt work.
Thanks
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
yes it was enabled through out the job.
i used the file1 and corresponding schema file in the seqentual file stage.
and in the transfomer on the target side i created 6 output columns which have same col names as in the schema file abd when i run the job it works fine.
but when i use the same file 1 and corresponding schema file in the seq file stage and when i defined 9 output cols on the target side of transformer it throws an error saying col7 is missing.
since i wanted to make this common job i was wondering how to achiveve dynamic mapping based on the schema file.
Thanks
i used the file1 and corresponding schema file in the seqentual file stage.
and in the transfomer on the target side i created 6 output columns which have same col names as in the schema file abd when i run the job it works fine.
but when i use the same file 1 and corresponding schema file in the seq file stage and when i defined 9 output cols on the target side of transformer it throws an error saying col7 is missing.
since i wanted to make this common job i was wondering how to achiveve dynamic mapping based on the schema file.
Thanks
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: