Home » Infrastructure » Unix » my cron job do not call datastage job
my cron job do not call datastage job [message #222890] Tue, 06 March 2007 20:45 Go to next message
agathaeleanor
Messages: 4
Registered: March 2007
Junior Member
hi all,

the sript is not really working to invoke datastage job
can anyone help? The script running in .sh

su - dsadm -c "/ardent/Ascential/DataStage/DSEngine/bin/dsjob -run -mode NORMAL -param FILE_NAME=sms0-${_year}-${_month}-${newday}.unl -param OUTPUT_FILE_NAME=${_year}-${_month}-${newday}-psa.unl LOGICA_TRANS2 logica_psa_inss" >> /dsprod01/LOGICA_TRANS/script/test.log
Re: my cron job do not call datastage job [message #222891 is a reply to message #222890] Tue, 06 March 2007 20:55 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
My car won't go.
Please tell me to to make my car go.
A post without any facts, deserves a response without solution.
Re: my cron job do not call datastage job [message #222893 is a reply to message #222890] Tue, 06 March 2007 21:14 Go to previous messageGo to next message
agathaeleanor
Messages: 4
Registered: March 2007
Junior Member
Hi anacedent,
here is the detail of my script. It worked fine but when it runs together with this

su - dsadm -c "/ardent/Ascential/DataStage/DSEngine/bin/dsjob -run -mode NORMAL -param FILE_NAME=sms0-${_year}-${_month}-${newday}.unl -param OUTPUT_FILE_NAME=${_year}-${_month}-${newday}-psa.unl LOGICA_TRANS2 logica_psa_inss" >> /dsprod01/LOGICA_TRANS/script/test.log

it dont seems to work fine


#!/usr/bin/sh

_day=`date +%d`
_month=`date +%m`
_year=`date +%Y`
newday=`expr $_day - 03`
echo "Two days ago was $_month/$newday/$_year "

READY="/dsprod01/LOGICA_TRANS/Ready"
DAILY="/dsprod01/LOGICA_TRANS/daily"
SCRIPT="/dsprod01/LOGICA_TRANS/script"
TRNSFERPATHRAW="RAW"
TRNSFERPATHPROCESSED="PROCESSED"
TRNSFERPATH104="logica_balance_daily"

echo "starting for ${DTYR}:"
echo "get from QM..."
grab files from QM server
ftp -i -n 172.28.200.89 << EOF
user Administrator tmtouch
bin
lcd ${DAILY}
cd ${TRNSFERPATHRAW}
echo "mget inp1*${_year}*${_month}*${newday}*gz"
mget inp1*${_year}*${_month}*${newday}*gz
mget inp2*${_year}*${_month}*${newday}*gz
mget inp3*${_year}*${_month}*${newday}*gz
mget inp4*${_year}*${_month}*${newday}*gz

quit
EOF



cd /dsprod01/LOGICA_TRANS/daily
echo ${_year}-${_month}-${newday} > date2.txt


cat /dsprod01/LOGICA_TRANS/daily/date2.txt | while read DT

do

echo "Let the fun begin..."
echo
cd /dsprod01/LOGICA_TRANS/daily
gunzip inp1*${_year}*${_month}*${newday}*gz
gunzip inp2*${_year}*${_month}*${newday}*gz
gunzip inp3*${_year}*${_month}*${newday}*gz
gunzip inp4*${_year}*${_month}*${newday}*gz


cat inp2*${DT}.unl >> inp1-${DT}.unl

cat inp3*${DT}.unl >> inp1-${DT}.unl

cat inp4*${DT}.unl >> inp1-${DT}.unl


echo "Game Over..."
done

echo ${_year}-${_month}-${newday}

rm inp2*${DT}.unl
rm inp3*${DT}.unl
rm inp4*${DT}.unl



Re: my cron job do not call datastage job [message #222894 is a reply to message #222890] Tue, 06 March 2007 21:21 Go to previous messageGo to next message
agathaeleanor
Messages: 4
Registered: March 2007
Junior Member
correction of the previous script that invoke dsjob

echo ${_year}-${_month}-${newday}
su - dsadm -c "/ardent/Ascential/DataStage/DSEngine/bin/dsjob -run -mode NORMAL -param FILE_NAME=inp1-${_year}-${_month}-${newday}.unl -param OUTPUT_FILE_NAME=${_year}-${_month}-${newday}-inp.unl LOGICA_TRANS2 logica_inp_inss_Aug20_raw_data_onwards" >> /dsprod01/LOGICA_TRANS/script/test.log

the crontab goes like this

32 18 * * * su - dsadmin -c "/dsprod01/LOGICA_TRANS/script/testing2.sh" >> /dsprod01/LOGICA_TRANS/script/test.log
Re: my cron job do not call datastage job [message #222896 is a reply to message #222890] Tue, 06 March 2007 21:31 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
>it dont seems to work fine
My car don't work fine. Tell me what is wrong with it.

Re: my cron job do not call datastage job [message #222899 is a reply to message #222890] Tue, 06 March 2007 21:51 Go to previous messageGo to next message
agathaeleanor
Messages: 4
Registered: March 2007
Junior Member
I was about to utilize the script to do daily extraction. The script get files(inp)from one server to another and concatenate them as one file. After concatenating, it will go through the datastage job. Everything is fine till concatenating the file but not even starting job in datastage.

i am still new in unix. But I suspect the script that call dsjob has got something wrong in the parameter.
Re: my cron job do not call datastage job [message #223112 is a reply to message #222899] Wed, 07 March 2007 10:20 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
Try including a profile to set up your path, library path and other variables. See what's in your interactive environment using "env".

su - dsadm -c ". ~/cron_env; /ardent ...


Previous Topic: mailx error.
Next Topic: Problems with ufsrestore SunOS 5.8 Generic_108528-29
Goto Forum:
  


Current Time: Thu Dec 08 18:24:44 CST 2016

Total time taken to generate the page: 0.10214 seconds