To email a concurrent
program PDF output. We need to call a UNIX host script to read the file from
Oracle output directory and using UNIX command mailx, send the output as an
attachment to the email address.
UNIX script for sending
email:
#======================================================
=====
# derive settings
#======================================================
=====
FILE_IN_BASE=o${V_CURRENT_REQ_ID}.out
# output file generated by Application
FILE_ERR_BASE=l${V_CURRENT_REQ_ID}.log
# log file generated by Application
FILE_OUT=${APPLCSF}/${APPLOUT}
# output file directory
FILE_LOG=${APPLCSF}/${APPLLOG}
# log file directory
FILE_IN=${FILE_OUT}/${V_FILE_NAME}
FILE_ERR=${FILE_LOG}/${FILE_ERR_BASE}
#======================================================
=====
#Email Body
#======================================================
=====
#MESSAGE="Test
Message"
#======================================================
=====
#Check for Outfile
Validity and existence
#======================================================
=====
DATAFILE_COUNT='ls -l
$FILE_IN | wc -l'
if [ $DATAFILE_COUNT -eq
1 ]
then
echo "file!"
fi
if [ $DATAFILE_COUNT -lt
1 ]
then
echo "No input file
exists"
exit 1
fi
echo =======================================================
========
echo "Emailing
Outfile "
echo
======================================================= ========
uuencode $FILE_IN
Output.pdf| mailx -s "Test Request Output " $V_EMAILID
exit 0

Leave a comment