Using multiple 'FIND' commands in Edit Macro



TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...

Using multiple 'FIND' commands in Edit Macro

Postby swetha489 » Mon Apr 02, 2012 4:11 pm

Hi All,

I have a requirement where I have to find certain words in a COBOL program using an Edit Macro (I will be using both Rexx and Edit Macro commans in the same code). I have to first find the occurence of the PROCEDURE DIVISION and then the WORKING-STORAGE. I use the "FIND" command to accomplish this. It works fine when I am searching for the first term, however on searching for the second term, I get a RC(-4) although the second term (ie, WORKING-STORAGE) is present.

Please find below a snippet of the code. Both the FIND commands are issued in separate subroutines that are called consecutively.

SUBROUTINE1
    TERM = 'PROCEDURE'
    "FIND" TERM
    <do something>

SUBROUTINE2:
     WS = 'WORKING-STORAGE'
     "FIND" WS
      <do something>


I don't seem to understand what the problem is. It would be great if someone can help me out with this!
swetha489
 
Posts: 10
Joined: Wed Mar 14, 2012 4:16 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Using multiple 'FIND' commands in Edit Macro

Postby enrico-sorichetti » Mon Apr 02, 2012 4:15 pm

what you posted is completely useless !

that' s just the <pseudocode> You will have to post the REAL code!
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Using multiple 'FIND' commands in Edit Macro

Postby GuyC » Mon Apr 02, 2012 4:30 pm

That would make sense, because once you are positioned on "Procedure division" you will get "bottom reached" when searching for "Working-storage".
Maybe you should locate back to the top , or do a "find first"
I can explain it to you, but i can not understand it for you.
GuyC
 
Posts: 315
Joined: Tue Aug 11, 2009 3:23 pm
Has thanked: 1 time
Been thanked: 4 times

Re: Using multiple 'FIND' commands in Edit Macro

Postby swetha489 » Mon Apr 02, 2012 4:47 pm

Thank you Guy!
"FIND FIRST" solved the issue!
swetha489
 
Posts: 10
Joined: Wed Mar 14, 2012 4:16 pm
Has thanked: 0 time
Been thanked: 0 time


Return to TSO & ISPF

 


  • Related topics
    Replies
    Views
    Last post