Syntax Error in AIX but working in UX

MENU_INTRO(){
    date="`date`"
    HOSTNAME="`hostname`"
    if [ $# -gt 1 ]; then cols=$2
    else cols=2
    fi
    clear
    now=`date +%A,%B-%d-%Y@%H:%M:%S`
    echo "                            -: INFORMIX DBA MENU :- "
    echo "********************************************************************************"
    echo "$now"
    echo "--------------------------------"
    echo "HOST=`hostname`         LOGNAME=`logname`      PWD=`pwd`"
    echo "********************************************************************************"
    PRT_MENU
        function onstat_p(seq,v,p0,c0,pNR,cNR,pNF,cNF,c0,pf,cf,i,k,n,v0,N,n1){
        while(\"onstat -p\" | getline){p0=c0;pNR=cNR;pNF=cNF;c0=\$0;cNR++;cNF=NF
        if((cNR==(pNR+1))&&(cNR>1)&&(\$1~/^[0-9][0-9]*/)){
              split(p0,pf);split(c0,cf)
              for(i=1;i<=pNF;i++){n=pf;v0=cf;N[n]++;
                if(N[n]==1){n1=n}else{n1=n N[n]}
                k++;seq[0]=k;seq[k]=n1;v[n1]=v0
              }
            }
          }
          return(seq[0])
        }
        " | pg -csnp "(ONCONFIG & Recommended Parametrs:)Page %d>"
        ;;
      9) #MD#  9#Some more Info
      echo " USE FOLLOWING COMMANDS TO GET MORE INFO ABOUT OS

      modinfo - display information about loaded kernel modules
      rpcinfo - report RPC information
      psrinfo - print processor information
      pkginfo - display software package information
      " | pg -cnsp " Page %d>"
      ;;

----Here's the error-------

./dprogram.sh[65]: 0403-057 Syntax error at line 80 : `(' is not expected.
[

Line 80 = "  function onstat_p(seq,v,p0,c0,pNR,cNR,pNF,cNF,c0,pf,cf,i,k,n,v0,N,n1){

What is UX? What shell were you using on UX? And what version of that shell were you using on UX?

What shell are you using on AIX? And what version of that shell are you using on AIX?

The diagnostic you showed us says the error is on line 80 in your script, but you have shown us much less than 80 lines.

If looks like you are defining a function MENU_INTRO() and inside that function definition you are defining another function onstat_p() . Standard shell syntax doesn't allow a function to be defined inside another function.