AIX script, help I'm just a backup!

Hello, I am trying to get the following Lawson command to work in an AIX script for a developer and I'm stumped, the Admin for this server is on vacation and I have very limited AIX scripting knowledge, I cannot seem to get this to work no matter what I try...

lawcmp test900 ap HM500

This is a Lawson command (lawcmp) and is preceded by required variables which compile a job, when logged in as the user and typing it exactly as shown from the command line it works, however when I put that command in a script it doesn't run. Other parts of the script appear to be working ok, it's just this piece that's failing....I checked that the file permission's and owner for both the script and command were correct and they appear to be fine, the error messages indicate that it might not be able to find the right path but again, I am very limited with AIX scripting and unsure on how to fix this, please help!

exec(): 0509-036 Cannot load program lawcmp because of the following errors:
0509-150 Dependent module libsecls.so could not be loaded.
0509-022 Cannot load module libsecls.so.
0509-026 System error: A file or directory in the path name does not exist.

# ------------------------------------------------------------
# This script compiles a program from Zena
#-------------------------------------------------------------

if [ $# -lt 2 ]

then

echo "Not enough parameters supplied"

echo

echo " Usage: To compile programs"

echo " in the Production environment."

return

else

PGMNAME=$1

SYSCDIN=$2

ENVCODE=$3

echo " parameters set starting script "
fi
echo " system code" ${SYSCDIN}

SYSCODE=$SYSCDIN
#SYSCODE=$(expr "$SYSCDIN" : ".\(..\)")

LIBPATH="src"

LIBCODE=${SYSCODE}${LIBPATH}
echo ${LIBCODE}

typeset -l SYSCODE

typeset -u PGMNAME

typeset -l LIBCODE

typeset -l ENVCODE

echo "environment is " ${ENVCODE}

PL="test900"

#if [ ${ENVCODE} = " dev" ]
#
#then
#
# PL="test900"
#
#else
#
# PL="prod900"
#
#fi

typeset -l PL

echo "*****************************************************"

echo

echo " Compiling program "${PGMNAME}" in library "${LIBCODE}"."

echo

echo "*****************************************************"

cd /lawsonenv/app/${PL}/${LIBCODE}

#DESTINATION=/lawsonenv/app/${PL}/${LIBCODE}/

#echo "xxxx"${PL}"xxxxx"
#echo "xxxx"${SYSCODE}"xxx"
#echo "xxxx"${PGMNAME}"xxx"

#lawcmp ${PL} ${SYSCODE} ${PGMNAME}
lawcmp test900 ap HM500

DESTINATION=/lawsonenv/app/${PL}/${LIBCODE}/
if [ -a ${DESTINATION}${PGMNAME}.err ]

then

cat ${DESTINATION}${PGMNAME}.err

echo "Compile error!"

else

echo "Compile completed successfully!"

fi

After adding /lawson/gen/lib/shared to the PATH in the user's profile, su - userid -c 'sysdump P/L ...' worked.