Find a string in a PS.



IBM's Command List programming language & Restructured Extended Executor

Find a string in a PS.

Postby Viswanathchandru » Tue May 21, 2013 6:58 pm

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
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: Find a string in a PS.

Postby Akatsukami » Tue May 21, 2013 7:02 pm

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?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day

These users thanked the author Akatsukami for the post:
Viswanathchandru (Sat Jun 08, 2013 5:27 pm)
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post