load two diff text files using single sequential file stage

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Amar_nath
Participant
Posts: 56
Joined: Tue Apr 18, 2006 5:03 am

load two diff text files using single sequential file stage

Post 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...
sb_akarmarkar
Participant
Posts: 232
Joined: Fri Sep 30, 2005 4:52 am
Contact:

Post 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
Amar_nath
Participant
Posts: 56
Joined: Tue Apr 18, 2006 5:03 am

Post 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 ??
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

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

Post 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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
Amar_nath
Participant
Posts: 56
Joined: Tue Apr 18, 2006 5:03 am

Post 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.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post 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.
Amar_nath
Participant
Posts: 56
Joined: Tue Apr 18, 2006 5:03 am

Post 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..
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Amar_nath
Participant
Posts: 56
Joined: Tue Apr 18, 2006 5:03 am

Post 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 ?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Amar_nath
Participant
Posts: 56
Joined: Tue Apr 18, 2006 5:03 am

Post 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
sb_akarmarkar
Participant
Posts: 232
Joined: Fri Sep 30, 2005 4:52 am
Contact:

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
Post Reply