calling scripts using Execsh
Moderators: chulett, rschirm, roy
calling scripts using Execsh
Hi All,
I want to know how to call the shell script using ExecSH (before job subroutine)
my script is in the path /opt/IBM/test.ksh
Also i want to find the materials regarding the commands for ExecTCL that can be used in datastage.
any suggestions and guidance will be most welcome.
thanks in advance
I want to know how to call the shell script using ExecSH (before job subroutine)
my script is in the path /opt/IBM/test.ksh
Also i want to find the materials regarding the commands for ExecTCL that can be used in datastage.
any suggestions and guidance will be most welcome.
thanks in advance
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Put the pathname of the script in the Input Values field.
You can execute any valid UNIX command (though some would, of course, be unwise, such as halting the machine).
You can execute any valid UNIX command (though some would, of course, be unwise, such as halting the machine).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
In my script I am saving the wordcounts of CSV files to /opt/IBM/count_<<yesterdays date>.txt and i need to call this as the input file in the sequential stage.chulett wrote:Exactly, simply put the full path to the script in the Input Values field along with any parameters if needed. And you can use job parameters in any portion of that. If needed. ...
seq.stage--->Trf---->ODBC.Stage.
i want to use before sub routine and the script will give me the file in the above format. but i want to know how to call this file as a input without hardcoding.
thanks for suggestion.
thanks for your reply, but I need some more input on how to get previous date as the parameterchulett wrote:Pass in yesterday's date as a job parameter. Use it in both the ExecSH call and the Sequential File stage. ...
please trigger some ideas
I can get yesterday's date in a stagevariable using the code:
Oconv(@DATE-1,'DYMD[2,2,2]') -----> Prevday;
But how to get the above in a job parameter?
How are you calling this job?pxraja wrote: I can get yesterday's date in a stagevariable using the code:
Oconv(@DATE-1,'DYMD[2,2,2]') -----> Prevday;
But how to get the above in a job parameter?
if you are using a sequence, you can use 'user variables' stage to get the date and use this as input to your job parameter.
Another approach is to call your script as a filter in the sequential stage. Your script should write to STDOUT, rather than to a file. The sequential stage then reads STDOUT as though it were the input file.pxraja wrote: In my script I am saving the wordcounts of CSV files to /opt/IBM/count_<<yesterdays date>.txt and i need to call this as the input file in the sequential stage.
seq.stage--->Trf---->ODBC.Stage.
i want to use before sub routine and the script will give me the file in the above format. but i want to know how to call this file as a input without hardcoding.
thanks for suggestion.
If you need yesterday's date, get it from the O/S in your script.
See the doc on sequential stages, filter command for more details.
HTH,
Scott