Set Job parameters using unix script
Moderators: chulett, rschirm, roy
Set Job parameters using unix script
Hi,
I am trying to set job parameters using unix script in a before-job subroutine. Can anyone please suggest what should I use in my scrip to set job parameters dynamically?
Here I the script I am running right now, but encountering with an error.
DSSetParam(PJ_OCC_EVE_ETL_commcommunicatn, "insert_cnt", "cat "$1" | grep 'insert_cnt">.*<' | cut -d">" -f4 | cut -d"<" -f1")
I am basically trying to grab the insert_cnt value from my xml file into job parameter insert_cnt.
I used this command in the before-job subroutine:
sh #Base_Path#xmlcount.sh #Base_Path#t_comm_communicatn_COUNT_INCR_20070924080734.xml
Base path is the location of all my files.
Any help is appreciated.
Thanks,
KK
I am trying to set job parameters using unix script in a before-job subroutine. Can anyone please suggest what should I use in my scrip to set job parameters dynamically?
Here I the script I am running right now, but encountering with an error.
DSSetParam(PJ_OCC_EVE_ETL_commcommunicatn, "insert_cnt", "cat "$1" | grep 'insert_cnt">.*<' | cut -d">" -f4 | cut -d"<" -f1")
I am basically trying to grab the insert_cnt value from my xml file into job parameter insert_cnt.
I used this command in the before-job subroutine:
sh #Base_Path#xmlcount.sh #Base_Path#t_comm_communicatn_COUNT_INCR_20070924080734.xml
Base path is the location of all my files.
Any help is appreciated.
Thanks,
KK
-
- Premium Member
- Posts: 224
- Joined: Tue Sep 24, 2002 7:32 am
- Location: Denver, CO USA
Take a look at Ken Bland's job control process and code. You can download it from free from his website (which I can't remember off the top of my head right now). Sign up for his free membership and go download the utilities and documentation he makes available there.
In it you will find exactly what you need to have to successfully perform the functions you are wanting.
Bestest!
In it you will find exactly what you need to have to successfully perform the functions you are wanting.
Bestest!
Bestest!
John Miceli
System Specialist, MCP, MCDBA
Berkley Technology Services
"Good Morning. This is God. I will be handling all your problems today. I will not need your help. So have a great day!"
John Miceli
System Specialist, MCP, MCDBA
Berkley Technology Services
"Good Morning. This is God. I will be handling all your problems today. I will not need your help. So have a great day!"
Sorry, I've only gotten to work with Server so I can't speak to what Parallel can do. I'm assuming there is functionality there for it, but I would not be a good source for it. I know there are plenty of other gurus on this site who can though.
Give it a few hours and someone will take a shot at it.
Bestest!
Give it a few hours and someone will take a shot at it.
Bestest!
Bestest!
John Miceli
System Specialist, MCP, MCDBA
Berkley Technology Services
"Good Morning. This is God. I will be handling all your problems today. I will not need your help. So have a great day!"
John Miceli
System Specialist, MCP, MCDBA
Berkley Technology Services
"Good Morning. This is God. I will be handling all your problems today. I will not need your help. So have a great day!"
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The way that job parameters are set for parallel jobs (ultimately via a call to DSSetParam() function) is identical to the way the job parameters are set for server jobs and job sequences.
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.
Hi Ray,
Can you please provide an example? Can I use DSSetParam() in my unix script to set parameters?
If yes, that is exactly what I am doing right now. Here is my unix script.
#!/bin/sh
DSSetParam(PJ_OCC_EVE_ETL_commcommunicatn, "insert_cnt", "cat "$1" | grep 'insert_cnt">.*<' | cut -d">" -f4 | cut -d"<" -f1")
DSSetParam(PJ_OCC_EVE_ETL_commcommunicatn, "update_cnt", "cat "$1" | grep 'update_cnt">.*<' | cut -d">" -f6 | cut -d"<" -f1")
DSSetParam(PJ_OCC_EVE_ETL_commcommunicatn, "delete_cnt", "cat "$1" | grep 'delete_cnt">.*<' | cut -d">" -f8 | cut -d"<" -f1")
Am I missing anything here?
KK
Can you please provide an example? Can I use DSSetParam() in my unix script to set parameters?
If yes, that is exactly what I am doing right now. Here is my unix script.
#!/bin/sh
DSSetParam(PJ_OCC_EVE_ETL_commcommunicatn, "insert_cnt", "cat "$1" | grep 'insert_cnt">.*<' | cut -d">" -f4 | cut -d"<" -f1")
DSSetParam(PJ_OCC_EVE_ETL_commcommunicatn, "update_cnt", "cat "$1" | grep 'update_cnt">.*<' | cut -d">" -f6 | cut -d"<" -f1")
DSSetParam(PJ_OCC_EVE_ETL_commcommunicatn, "delete_cnt", "cat "$1" | grep 'delete_cnt">.*<' | cut -d">" -f8 | cut -d"<" -f1")
Am I missing anything here?
KK
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
DSSetParam() is not invoked from UNIX - hence my use of the word "ultimately".
If you're using the dsjob command line interface include as many -param name=value options as you require, or use a parameter file. Search the forum for details of each approach.
If you're using the dsjob command line interface include as many -param name=value options as you require, or use a parameter file. Search the forum for details of each approach.
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.
Hi,
Can you tell me how do I make a call to DSSetParams using unix script. My requirement is to set three job parameters using unix script and use these job parameters in the transformer stage. I am not executing anything at command promt. All this has to happen while runtime.
I tried to include my unix script in the before-job subroutine, but it doesn't like DSSetParams() call in the script.
Please advise.
KK
Can you tell me how do I make a call to DSSetParams using unix script. My requirement is to set three job parameters using unix script and use these job parameters in the transformer stage. I am not executing anything at command promt. All this has to happen while runtime.
I tried to include my unix script in the before-job subroutine, but it doesn't like DSSetParams() call in the script.
Please advise.
KK
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I just did.
DSSetParam() is a DataStage BASIC function. It also exists in the DataStage C language API. It can not be called from UNIX. You can write a small C program if you wish.
DSSetParam() is a DataStage BASIC function. It also exists in the DataStage C language API. It can not be called from UNIX. You can write a small C program if you wish.
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.