Setting up env variable in ksh

I am facing a very strange issue. I have script in ksh with #!/bin/ksh as shebang.

This script has function which sets the env variable before running other functions of the script. by

set_up_env()
{
  CONFIG_FILE="/opt/app/tools/deepmarking/latestVersion/script/UploadEnv"
  if [ -f ${CONFIG_FILE} ]
  then
    #Source the environment

   . ${CONFIG_FILE}
          else
    err_exit "ERROR: Config file doesnot exist"
  fi

 }

And the shell I am running this script is csh. But for some unknown reason, the env variable declared on the config file are not getting set properly and hence the purpose of the script is not achieved.
Sample Error:

: not foundksh: /opt/app/tools/deepmarking/latestVersion/script/UploadEnv[8]:
: not foundksh: /opt/app/tools/deepmarking/latestVersion/script/UploadEnv[29]:
: not foundksh: /opt/app/tools/deepmarking/latestVersion/script/UploadEnv[31]:
: not foundksh: /opt/app/tools/deepmarking/latestVersion/script/UploadEnv[35]:

But if i declare all these variables present on UploadEnv in the same script at the start. This works with out any issues.

A sample UploadEnv file

export SCRIPT_HOME="/opt/app/tools/deepmarking/latestVersion"
export LOG_DIR=${SCRIPT_HOME}/log
export DATA_DIR=${SCRIPT_HOME}/data
export SCRIPT_DIR=${SCRIPT_HOME}/script

Any help would be much appreciated.

this is the rigidness of csh..try developing CSH compatible statements in your sourced file or make them ready for CSH during run-time

awk '/export/ { gsub(/export/,"setnev",$0); gsub(/=/," ",$0 ); print  > "TempUploadVars" }' UploadEnv

and then source the TempUploadVars

. ./TempUploadVars

I am sourcing it like above.

But getting error as below now.

./TempUploadVars[1]: setnev: not found

please use source command in CSH..

The request is on ksh, not csh, as far as I can read.

export should not be a problem in ksh according to the man pages.
What exactly do you have in lines 8, 29, 31, and 35 in script uploadenv?

UploadEnv file

#!/usr/bin/ksh
########################################################
# Configuration variables for the Upload process
########################################################
export TODAY=`date +%Y%m%d`  ## YYYYMMDD
export TIME=`date +%H%M%S`   ## HHMMSS
export month=`date +"%Y%m"`
export lmonth=`date +"%Y%m" -d last-month`

export MAIL_TO="email@example.com"
export SCRIPT_HOME=/home/user/deepmarking
export LOG_DIR=${SCRIPT_HOME}/log
export DATA_DIR=${SCRIPT_HOME}/data
export SCRIPT_DIR=${SCRIPT_HOME}/script
export BACKUP_DIR=${SCRIPT_HOME}/data/backup
export DB_ITNAPP_R_USER=itnapp
export DB_ITNRO_E_PASSWD="aswQrtQU3YnQrdXA="
export DB_ITNRO_D_KEY="K3UFQN215bTZBN1MwZVA="
export DB_ITNAPP_R_SID=nothing
export LOGFILE=${LOG_DIR}/Job.log
export FTPSERVER=ftpserver.example.com
export FTP_DATA_DIR=/tmp/deepmarking/data
export FTPUSER=ftpuser
export FTP_E_PASSWD="VFpybHRzTmFDSzF4aGVjVDMUY1NHJoOTc="
export FTP_D_KEY="ZnBpNTZIlF1SkZkVlJZRElVQWI0WDg="
export PGPPATH=/opt/pgp/bin
export JAVAPATH=/opt/java/jdk1.6.0_24/bin
export JAR_FILE=${SCRIPT_DIR}/endcrypt-dbcp-jar-with-dependencies.jar
export OLDFILEDAYS=10

export FILE=${lmonth}01

export FTP_LOG_FILE=${LOG_DIR}/ftp_files_$TODAY\_$TIME.log

Oh, you prefer leaving the line counting up to us. Where is line 35?

I posted the whole file. There is nothing missing here... so the 35th line is the last line..