Page 1 of 1

Calling a script through a routine

Posted: Mon Aug 31, 2009 12:31 am
by Sgiri1
Hi,

I need to call a perl script through a routine. any specific commands to do the same. I am not opting an execute command stage to do the same since i have to apply the functionality of the script over few columns in the job.

Posted: Mon Aug 31, 2009 1:15 am
by ArndW
Do you mean a C++ routine or a DS Basic routine? You posted in General, but as a PX type and the answer depends upon where you wish to execute a shell command from.

Posted: Mon Aug 31, 2009 5:20 am
by chulett
So, execution of a perl script once per row inside your job? That's really going to kill performance, are you sure there's no better approach available here? What does the script do?

Posted: Mon Aug 31, 2009 11:00 am
by arnabdey
Simply use DSExecute function inside your routine and invoke the PERL script as you invoke normal UNIX scripts. You can search for the syntax and usage over the internet.

Posted: Tue Sep 01, 2009 12:02 am
by Sgiri1
chulett wrote:So, execution of a perl script once per row inside your job? That's really going to kill performance, are you sure there's no better approach available here? What does the script do? ...
My script has a set of regex and the i/p data for certain columns in the table has to be validated against these regexes. since i have to validate only for couple of columns in the table i cannot go for execute command stage or before and after subroutines in job properties.

Posted: Tue Sep 01, 2009 12:23 am
by ArndW
I am not sure if you are aware of the performance impact of calling a perl script once per row in your job. Are you certain that you cannot emulate your regular expressions within DataStage?

Posted: Tue Sep 01, 2009 2:34 am
by Sainath.Srinivasan
If the source is from a database, why don'y you perform your regex there itself ?