#=================================================================================== # Bank statement #=================================================================================== # Will need to call "Bank Statement Import & Autoreconcilation " # Under Cash Management su # $1 user/pwd # $5 arg1 # -- History # Location of where control file location v_ctl_dir=$XBOL_TOP/bin/XLTHBSMBBI.ctl # Location/Folder where all the csv file are located v_src_loc=$XBOL_TOP/int/incoming/bsmbb/MBB* # Archive Directory v_archive=$XBOL_TOP/int/archive # SQLLDR env v_sqlldr_bad=$XBOL_TOP/int/bad v_sqlldr_log=$XBOL_TOP/int/log # Uniq Identifier v_uniq_id=$(date +%d%m%y%H%M%S) # *Check if the source (csv) files exist v_exist=$(ls -l $v_src_loc 2>/dev/null| wc -l) # Check if there are any source file exist (dat) if [ $v_exist -ge 1 ] then # If source file exist then process for fil in $(ls $v_src_loc) do v_file_id=$(echo $fil | awk -F / '{ print $9 }' | sed 's/.dat//') sqlldr userid=$1 control=$v_ctl_dir data=$fil log=$v_sqlldr_log/$v_file_id-$v_uniq_id.log ##sqlldr userid=apps/apps control=$v_ctl_dir data=$fil log=$v_sqlldr_log/$v_file_id-$v_uniq_id.log sqlplus -S $1 @$XBOL_TOP/sql/XLTHBSMBBIb.sql ##sqlplus -S apps/apps @$XBOL_TOP/sql/XLTHBSMBBIb.sql echo "###################################################################################" # Load data into staging table echo "" echo "Loading to staging tables" echo "=========================" echo "" # After completing the process move to archive directory mv $fil $v_archive done else echo "######################################################" echo ">>>There is no source file to load to interface table" echo "######################################################" fi