Typeset -i in MVS (Mainframe system)

Hi,

I have one job that runs daily and creates daily files. At the end I compare the today's file with previous day's file. And if today's file size is greater or equal to previous day's file, then it is ok, else I need to through error.
I have following piece of code:

typeset -i SIZE_CURRDATE
typeset -i SIZE_PREVDATE
DAY=`echo $RUN_DATE | cut -c 5-6`
if [ $DAY -ne "01" ] ; then
SIZE_CURRDATE=`m_ls -l mfile:file_name |  awk '{ print $5 }' | sed 's/,//g'`
SIZE_PREVDATE=`m_ls -l mfile:file_name |  awk '{ print $5 }' | sed 's/,//g'`

echo "PREV_DATE : " $PREV_DATE
echo "SIZE_CURRDATE : " $SIZE_CURRDATE
echo "SIZE_PREVDATE : " $SIZE_PREVDATE
if [ $SIZE_CURRDATE -le $SIZE_PREVDATE ] ; then
 echo "ERROR : The output file is of zero length."
 exit -1
else
 echo "OK"
fi
fi

This runs fine in AIX UNIX. But it is giving arithmatic overflow error in MVS USS system when file size is more or equal to 10 digits.
Could you please help me to solve this?

If your shell supports the -l option in typeset, try to define your variables with typeset -il . That gives you the long version of integer variables.

$ typeset -i var1=2222222222
$ typeset -il var2=2222222222
$ print -- $var1 $var2
-2072745074 2222222222

(using ksh93t+ on Solaris 10)

Hi,
Thanks a lot for your reply!
I am running it in MVS system. So using

typeset -il

also giving arithmatic overflow error.