Issue with the unix After job subroutine
Posted: Thu Jun 04, 2009 3:58 am
Hi all,
I am using the below unix script is it possible to call DS functions in the script.
Please guide me on this.
#! /usr/bin/ksh
# Load into od_trans_map_output table for HALO Transaction Mapping
#$INCLUDE DSINCLUDE JOBCONTROL.H
echo $1 $2 $3 $4 $5 $6
isql -U$4 -P$5 -S$2 <<-EOI1
use $3
go
truncate table $3..od_trans_map_output_new
go
EOI1
bcp $3..od_trans_map_output in $1 -U$4 -P$5 -S$2 -c -t "," > $6'\'od_trans_map_opt.log
LOG_COUNT=`grep -c 'failed' od_trans_map_opt.log`
Log=`grep -n 'failed' od_trans_map_opt.log`
echo "count:$LOG_COUNT"
if $LOG_COUNT = 1 then
call DSLogFatal("The job aborted because of bcp failed ","ExecSH")
# Abort
end
else
cat od_trans_map_opt.log
fi
I am using the below unix script is it possible to call DS functions in the script.
Please guide me on this.
#! /usr/bin/ksh
# Load into od_trans_map_output table for HALO Transaction Mapping
#$INCLUDE DSINCLUDE JOBCONTROL.H
echo $1 $2 $3 $4 $5 $6
isql -U$4 -P$5 -S$2 <<-EOI1
use $3
go
truncate table $3..od_trans_map_output_new
go
EOI1
bcp $3..od_trans_map_output in $1 -U$4 -P$5 -S$2 -c -t "," > $6'\'od_trans_map_opt.log
LOG_COUNT=`grep -c 'failed' od_trans_map_opt.log`
Log=`grep -n 'failed' od_trans_map_opt.log`
echo "count:$LOG_COUNT"
if $LOG_COUNT = 1 then
call DSLogFatal("The job aborted because of bcp failed ","ExecSH")
# Abort
end
else
cat od_trans_map_opt.log
fi