what is best way to do ?

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

thumati.praveen
Participant
Posts: 106
Joined: Wed Oct 04, 2006 5:21 am

what is best way to do ?

Post by thumati.praveen »

Hi,


I need to read 10 files from the single directory.These files are different file name and different data for different table loads.

The process will run in two phases one is validation if it is success then start the second phase transformation otherwise the whole process needs to be stoped.

we want to run all files at same time in single run.

How i need to design job can any give me a push up please.

Thanks&Regards,
Praveen.
Maveric
Participant
Posts: 388
Joined: Tue Mar 13, 2007 1:28 am

Post by Maveric »

Need more information. What kind of validations? What kind of transformations? Is meta data same across all the 10 files? If one file fails a validation, then should all the loads be stopped?
thumati.praveen
Participant
Posts: 106
Joined: Wed Oct 04, 2006 5:21 am

Post by thumati.praveen »

All validations and transformations done.we need to arrange the jobs in a sequence.

In one sequence we need to process all file validations.For that i need to read files one by one but I dont want to read one by one I want to read all 10 files at one time. By using which stages and which job design i can achive this?

Thanks&Regards,
praveen
thumati.praveen
Participant
Posts: 106
Joined: Wed Oct 04, 2006 5:21 am

Post by thumati.praveen »

The meta data is different for all.If one file fail all should stop the process.

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

Post by ray.wurlod »

If the metadata are different for each file create ten separate jobs to do the validation. Take OK triggers from each job activity into a Sequencer set to fire only if All of its inputs have fired. Make sure there is an alternative exit from the job sequence, for example non-OK triggers or automatic handling of exceptions.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
thumati.praveen
Participant
Posts: 106
Joined: Wed Oct 04, 2006 5:21 am

Post by thumati.praveen »

ray.wurlod wrote:If the metadata are different for each file create ten separate jobs to do the validation. Take OK triggers from each job activity into a Sequencer set to fire only if All of its inputs have fired. ...

Hi,

The validation jobs all were done.The problem is i need to run all jobs one time for that i need to send the file names for all jobs at run time.

Here one more problem also that is when the file was not run in the previous run that file we need to run first in the second run.

can you give me any ideas about imlementaion?


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

Post by ray.wurlod »

If the metadata are different for each file create ten separate jobs to do the validation. Take OK triggers from each job activity into a Sequencer set to fire only if All of its inputs have fired. Make sure there is an alternative exit from the job sequence, for example non-OK triggers or automatic handling of exceptions. Use job parameter to supply the file name to each of the ten jobs.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
thumati.praveen
Participant
Posts: 106
Joined: Wed Oct 04, 2006 5:21 am

Post by thumati.praveen »

ray.wurlod wrote:If the metadata are different for each file create ten separate jobs to do the validation. Take OK triggers from each job activity into a Sequencer set to fire only if All of its inputs have fired. Ma ...

Hi Ray,

All things was done properly.

The exact problem is now i am getting here when i am trying to run the executecommand activity through the sequence the command is executing in the /home/dsadm location.


But i want to execute the unix command in the some other location like /etl/source/data here my files are located i want to execute here.
Is their any way to execute the unix command through Execute command activity?


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

Post by chulett »

:? What command? Either supply a full path or explicitly 'cd' there first.
-craig

"You can never have too many knives" -- Logan Nine Fingers
thumati.praveen
Participant
Posts: 106
Joined: Wed Oct 04, 2006 5:21 am

Post by thumati.praveen »

chulett wrote::? What command? Either supply a full path or explicitly 'cd' there first. ...
command: ls -1|grep "xyz"|sort -u -r -t"." +5|head -1
parameter:etl/source/data
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

command: cd pathname && ls -1|grep "xyz"|sort -u -r -t"." +5|head -1
parameter:etl/source/data
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

command: source
parameter: cd #pathname# && ls -1|grep "xyz"|sort -u -r -t"." +5|head -1
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not quite sure what 'source' is, so...

command: sh
parameter: cd #pathname# && ls -1|grep "xyz"|sort -u -r -t"." +5|head -1

Where 'pathname' is a job parameter for the directory to execute the command in - in your case that would be '/etl/source/data'.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

source is the long form of . for executing shell scripts.

See man source for more information.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

First thing I tried when I saw your post was 'man source' but on our HP-UX systems I got nada. Guess I'll stick with the short form. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply