ksh + isql => output cut at 2 GB

Using a ksh script, I'm dumping the data from our sybase database into an output file. This output file is for what ever reason cut at 2GB.

There is enough space on the unix machine and as there is no error message is received I have no clue to start looking for a solution.

#! /usr/bin/ksh

# This scripts extracts data from Sybase for the audit. A complete subscriber dump is retrived
#
# ----------------------------------------------------------------------

checkError()
{
STATUS=$1
if [[ $STATUS != 0 ]] 
then
  echo "[$STATUS] - $2"
  exit $STATUS
fi
}

function getDate
{
  print -n "`date '+%Y%m%d.%H%M%S'`"
}

. $AUDIT_MAIN_HOME/bin/audit.conf

SUBPATH=./$0
export SUBPATH=${SUBPATH%/*}

$SUBPATH/../common/outputFile_date.sh $*

checkError $? "parameter checking failed"

export OUTPUT_FILE=$1
export INPUT_DATE=$2
export INPUT_NDC=470

# replaces .sh by .sql
export SQL_SCRIPT=${0%.sh}.sql
echo SQL_SCRIPT[$SQL_SCRIPT]

. $SUBPATH/db_parameter.sh

SQL_EFFECTIVE_DATE=$INPUT_DATE

# A new temporary query is created
SQL_SCRIPT_TMP=$SQL_SCRIPT.tmp
rm -f $SQL_SCRIPT_TMP

#----------

PROGRAM=$AUDIT_MAIN_HOME/jar/buildQuery.jar
CMD="$JAVA_BIN/java -jar $PROGRAM \
-input_file $SQL_SCRIPT \
-db_area $TMP_DATABASE \
-effective_date $SQL_EFFECTIVE_DATE \
-ndc $INPUT_NDC \
-mapping_file $AUDIT_MAIN_HOME/input/hlrd/pni_hlrd_mapping.xml"
echo CMD[$CMD]
$CMD

SQL_PARAMETERS="$SQL_SCRIPT_TMP $OUTPUT_FILE $SQL_EFFECTIVE_DATE $INPUT_NDC $TMP_DATABASE"
echo "Executing SQL_PARAMETERS[$SQL_PARAMETERS]"

# ISQL
#-----
DBCONNECTION="$SYBASE_OCS/bin/isql -S$SERVER_NAME -U$USER_NAME -P$PASSWD  \
-w1000 -o$OUTPUT_FILE -A8192 -b -i$SQL_SCRIPT_TMP"

echo DBCONNECTION[$DBCONNECTION]

# Defines the start of the query
getDate | read START_TIME
export START_TIME

echo $PASSWD|$DBCONNECTION

# Defines the end of the query
getDate | read END_TIME
export END_TIME

checkError $? "Error in the dump process"

# File created?
[[ -f $OUTPUT_FILE ]]
checkError $? "not created file[$OUTPUT_FILE]"

# build file report
$SUBPATH/../common/fileDescr.sh

checkError $? "pni query failed failed"

---------- Post updated at 01:06 PM ---------- Previous update was at 09:38 AM ----------

Does anyone have an idea why the -o option doesn't create files > 2 GB?
Using the > I can create larger files.

Suggest look up your Operating System exact make and version and exact version of Sybase, then look at this article from Sybase:

Sybase Technical News - Volume 8, Number 1 Newsletter: Database Management - Sybase Inc

Obviously there may be later articles for later Operating Systems.