John,
Great to see that your development is working. I was not available last 3 days so it was not possible for me to post another solution. If someone is interested by this other way, i post this trick.
As you will see, there is not need to develop into JDEdwards and this trick will work for all ube. You can look into your configuration table (me i was using OSA table as the standard does).
As i said before, just rename runbatch into system/bin32 and create a new runbatch with script like below. The script will look up when the batch is finished, lookup into a table to see if an email should be send, run the batch, ans send the email :
#!/bin/ksh
PQUEUE=“/jdedwards/E910/PrintQueue"
create_mail()
{
batch=`sqlplus -s "svm910/svm910@JDEE1 << EOF
set heading off feedback off verify off
select JCJOBSTS,JCPROCESSID from svm910.F986110 where JCFNDFUF2 = '$1';
exit;
EOF`
set -- `echo "$batch" | sed -e 's/*\(*\)/\1/g'`
status=`echo "$1"`
batchid=`echo "$2"`
if [ $status = "D" ]
then
all=`sqlplus -s "svm910/svm910@JDEE1 << EOF
set heading off feedback off verify off
select JCFNDFUF2 from svm910.F986110 where JCPROCESSID=$batchid;
exit;
EOF`
for i in $all
do
batch_name=`echo $i|sed 's/_/ /g'`
set -- `echo "$batch_name" | sed -e 's/*\(*\)/\1/g'`
name=`echo "$1"`
version=`echo "$2"`
send_email=`sqlplus -s “SY910/SY910@JDE”1” << EOF
set heading off feedback off verify off
select count(*) from SY910.F986168 where OHOBNM='$name' and OHENHV='$env' and (OHUGRP='$username' or OHUGRP='*PUBLIC');
exit;
EOF`
if [ $send_email = "1" ]
then
cp $PQUEUE/$i $PQUEUE/$i.pdf
mail ######## to replace with mail function on aix ##############
fi
done
fi
}
batch_name=`basename $6`
env=`echo $3`
username=`basename $1`
runbatch_ow $*
create_mail $batch_name
Regards
Franck