Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ksh cannot open .sql file using Autosys job

Status
Not open for further replies.

johnpayback

IS-IT--Management
Oct 2, 2006
110
US
I have the script below which works via command line. When ran using Autosys it fails with the Autosys log saying "cannot open dialer_extract.sql". All files are in the same directory unless otherwise noted in the script.

What am I doing wrong and how do I fix it?

NOTE: I also tried adding the environment variables rather than executing the .profile. No luck.

"dialer_extract.sql" permissions set to 755
"dialer_extract.sql" SPOOL's to purge.txt

Code:
#!/bin/ksh
. /users/apps/jp/.profile
pathlog=/users/apps/jp/bin/ksh
filelog=purge.txt
email='jp@somewhere.com'
read upass < /users/apps/jp/bin/ksh/pw

sqlplus -s /nolog <<EOSQL
connect ${upass}
@dialer_extract.sql
exit
EOSQL

( cat <<-MSG
Hello,

Please see the attached dialer extract file.

Thank you,
JP
MSG

uuencode ${pathlog}/${filelog} ${filelog}
) | mailx -s "Dev - Dialer Extract" ${eMail}

JP

BS/Computer Science
 
Have you tried putting the fill pathname to the sql in the sqlplus session?

The internet - allowing those who don't know what they're talking about to have their say.
 
fill = full.

Fat fingers!

The internet - allowing those who don't know what they're talking about to have their say.
 
Yes I have tried the full path with no luck.

JP

BS/Computer Science
 
Just a follow up. The problem is that Autosys looks at the home directory of the account/profile you specify. So you have to put in absolute paths for everything in the ksh script and the .sql file. (Any where there is a file defined you have to use an absolute path)

JP

BS/Computer Science
 
Souds like Autosys works in a similar way to the traditional cron then.

The internet - allowing those who don't know what they're talking about to have their say.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top