Page 1 of 2

load two diff text files using single sequential file stage

Posted: Tue Jun 13, 2006 11:53 pm
by Amar_nath
Hi Folks,
I'm trying to load two different text files(same columns) to a table in server job which loads data from a sequential file stage(source) to a ODBC stage(target) and I'm having a little difficulty that I hope someone can help me with.

Background::
I have tried with 'job sequencing' in which I hv used same server job 2 times in 1 st activity i have given filepath of 1st file in Enviornment variable and in 2nd job activity file path of another file.
It works fine.

QUESTION::
I want to load the two different files "Parallely" not one after one.
How do I do that??
Any ideas are most welcome, thanks...

Posted: Wed Jun 14, 2006 12:12 am
by sb_akarmarkar
Take two link from flat file with diffrent file name to target with same name it will execute sequntailly one after another.


Thanks,
Anupam

Posted: Wed Jun 14, 2006 12:29 am
by Amar_nath
hi Anupam,

I think u have not read the Question completely.I dont want it sequentialy.
And also I dont want to add new stage in my job.

can I do that ??

Re: load two diff text files using single sequential file st

Posted: Wed Jun 14, 2006 12:30 am
by balajisr
Amar_nath wrote:Hi Folks,
I'm trying to load two different text files(same columns) to a table in server job which loads data from a sequential file stage(source) to a ODBC stage(target) and I'm having a little difficulty that I hope someone can help me with.

Background::
I have tried with 'job sequencing' in which I hv used same server job 2 times in 1 st activity i have given filepath of 1st file in Enviornment variable and in 2nd job activity file path of another file.
It works fine.

QUESTION::
I want to load the two different files "Parallely" not one after one.
How do I do that??
Any ideas are most welcome, thanks...
I assume that as per subject of the post given by you that you have two different sequential files and want to load the file to a table using a single sequential file stage.

In this case,You can cat the two files to make it as a single file and use the sequential file stage to load the database.

Posted: Wed Jun 14, 2006 12:35 am
by ArndW
Make your DataStage load job into a multinstance job, start two concurrent instances of this job, each using a different source file passed in as a parameter and you have your solution.

Posted: Wed Jun 14, 2006 12:39 am
by Amar_nath
hey thanks for reply,

but the job is going to run frequently and the data is going to be changed with same file names.
Its not fisible to cat 2 files that every time.

Posted: Wed Jun 14, 2006 12:41 am
by balajisr
Amar_nath wrote:hey thanks for reply,

but the job is going to run frequently and the data is going to be changed with same file names.
Its not fisible to cat 2 files that every time.
Follow what ArndW has mentioned in the previous post.

Posted: Wed Jun 14, 2006 1:26 am
by Amar_nath
hi ArndW,

thanx i think it will help me,

i m new to this multinstances,

i have done(validated) 2 instances of same job with diff file path as parameter,

now how to run these two instances at a time ??

i cant shcedule it..

Posted: Wed Jun 14, 2006 1:35 am
by ray.wurlod
Start them at the same time, but with different invocation IDs.

An invocation ID may be any string.

The file name would need to be a job parameter, which would obviously have a different value in each invocation.

However, if the files are not identical in record layout, multi-instance jobs are not the solution. You need separate jobs, or separate streams in the one job. It can be done with one Sequential File stage, but this stage requires two links, one for each file. The metadata on each link will be different from on the other link.

Code: Select all

stream1 ---->  Sequential
stream2 ---->  File Stage

Posted: Wed Jun 14, 2006 2:05 am
by Amar_nath
hi Ray ,

I have created instances with different invocation IDs but I am not able to
run those at same time .

I cant use shcedular for that.

how can I do that ?

Posted: Wed Jun 14, 2006 2:36 am
by ArndW
Amar - instances are designed so that they can run at the same time. Can you tell us what problems you are having when you try to run them at the same time?

Posted: Wed Jun 14, 2006 3:46 am
by ray.wurlod
Are you ensuring that the file names are different? You are not permitted (by the operating system) to have two processes write to one file at the same time.

Posted: Wed Jun 14, 2006 4:14 am
by Amar_nath
ArndW,

I have created 2 job invocation's in DS Director ,in job status it shows me
myjob Validated OK
myjob.invo1 Validated OK (parameter is file1's path)
myjob.invo2 Validated OK (parameter is file2's path)

now i want to run these 2 invocations . If i click on one of these then only run is active if i select both of them then its not.

how to do that

Posted: Wed Jun 14, 2006 4:43 am
by sb_akarmarkar
Amar_nath wrote:ArndW,

I have created 2 job invocation's in DS Director ,in job status it shows me
myjob Validated OK
myjob.invo1 Validated OK (parameter is file1's path)
myjob.invo2 Validated OK (parameter is file2's path)

now i want to run these 2 invocations . If i click on one of these then only run is active if i select both of them then its not.

how to do that

You need to create sequnce to run this job or you need to schedule this job ...

Thanks,
Anupam

Posted: Wed Jun 14, 2006 5:04 am
by ArndW
Create a sequence with 2 job activity stages; put the correct instance name (any names will do as long as they are different) and the correct parameter file name, compile and run.