Calling a script through a routine

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
Sgiri1
Participant
Posts: 43
Joined: Sat Nov 08, 2008 10:58 pm
Location: Tambaram

Calling a script through a routine

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

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
arnabdey
Participant
Posts: 50
Joined: Wed Jan 10, 2007 5:56 am

Post 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.
Arnab
Sgiri1
Participant
Posts: 43
Joined: Sat Nov 08, 2008 10:58 pm
Location: Tambaram

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

Post 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?
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

If the source is from a database, why don'y you perform your regex there itself ?
Post Reply