What does your function rep2 look like? Please include all the code.
>thanks Tore
>
>I am calling with
>
>SELECT 17
>scan
> * c3 = ALLTRIM(LEFT(examcode ,5))
> c3=LEFT(ALLTRIM(CHRTRAN(examcode,"0123456789","")),3)
>
>*c3=examcode
> replace nmonth WITH Rep2(c3)
>ENDSCAN
>
>I get Data type mismatch