Page 1 of 1

Find a string in a PS.

PostPosted: Tue May 21, 2013 6:58 pm
by Viswanathchandru
Dear all,

I'm trying to find the position of a string in a PS file. But it shows not found. Here is what I have tried. Please let me know if I'm doing something wrong.


"EXECIO * DISKR OUTTR(STEM RET. FINIS"             
DO IX=1 TO RET.0                                   
 VAR1 = POS('ERROR','RET.IX')                   
END                                               
SAY VAR1


Regards,
Viswa

Re: Find a string in a PS.

PostPosted: Tue May 21, 2013 7:02 pm
by Akatsukami
As RET.IX is enclosed in single quotes, it is interpreted as a literal; remove those quotes. Incidentally, you realize that your code will only show the position of "ERROR" in the last line, yes?