#!/bin/csh -f
#**********************************************************************
#
# name to seperate file into some parts in split based on file sise
#**********************************************************************
#to check that the file's exist
if (-e $TMP_DIR/xxx.dat) then
#To get file's size
@ fileSize = `ls -l $TMP_DIR/xxx.dat | awk '{ print $5 }'`
#To get the record counts(34 is the length of record)
@ recCnt = $fileSize / 34
#right seperated record count(eg.two splited)
@ splitCnt = $recCnt / 2
@ splitCnt = $splitCnt + 1
#To get splited size
@ splitbytes = $splitCnt * 34
split -b $splitbytes $TMP_DIR/xxx.dat $TMP_DIR/xxx.dat
if ($status != 0) then
exit(99)
endif
endif
# If splited file is much more than right counts
if (-e $TMP_DIR/xxx.datac) then
rm -f $TMP_DIR/xxx.dataa
rm -f $TMP_DIR/xxx.datab
rm -f $TMP_DIR/xxx.datac
exit(88)
endif
rm -f $TMP_DIR/xxx.dat
mv -f $TMP_DIR/xxx.dataa $TMP_DIR/xxx00.dat
mv -f $TMP_DIR/xxx.datab $TMP_DIR/xxx01.dat
exit(0)