you could use
if (pending='I' and len(allt(actdoc))=9)
...
>pending = 'I'
>actcod = '123456789'
>IF (pending = "I" .AND. actcod = SPACE(9))
> SELECT records.......
>ELSE
> SKIP
>ENDIF
>
>the condition is true but the else part execute. any idea....
robert.oh.