Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Problem in Repeated FIND in ISPF Edit MACRO

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
Soumya Roy

New User


Joined: 19 Feb 2009
Posts: 10
Location: Bangalore

PostPosted: Wed Jul 13, 2011 3:30 pm    Post subject: Problem in Repeated FIND in ISPF Edit MACRO
Reply with quote

Hi,

I am doing a "FIND ALL" to get the number of occurrence of the string
': PROC'.
After that I'm doing "FIND NEXT" to search the above string throughout the MEMBER.

Till this point, it was successful.

After the above, I need to search another string which should look like: "END PARANAME"

I have an array INP. which has the PARA names[like : INP.1 = PARA1, INP.2 = PARA2 etc]

Now I am trying to search the string as:

STR2FND = 'END 'INP.idx''

"ISREDIT FIND FIRST '(STR2FND)'"

However the search is not successfull this time and it's actually searching the last string found from the previos search[the last result of the prev search is ': PROC']. It's not at all searching the value in the variable STR2FND.

Could you please share some idea? I'm not sure if there is any syntax error.
Back to top
View user's profile Send private message

Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1248
Location: Israel

PostPosted: Wed Jul 13, 2011 4:26 pm    Post subject: Reply to: Problem in Repeated FIND in ISPF Edit MACRO
Reply with quote

Your explanations are not clear at all, specifically this part:
Quote:
However the search is not successfull this time and it's actually searching the last string found from the previos search[the last result of the prev search is ': PROC'].

Code:
"ISREDIT FIND FIRST '(STR2FND)'"
Are you sure this is exactly how your command is coded ?
According to the quotes, you are looking for (STR2FND)
Back to top
View user's profile Send private message
Soumya Roy

New User


Joined: 19 Feb 2009
Posts: 10
Location: Bangalore

PostPosted: Wed Jul 13, 2011 5:04 pm    Post subject: Reply to: Problem in Repeated FIND in ISPF Edit MACRO
Reply with quote

Quote:
However the search is not successfull this time and it's actually searching the last string found from the previos search[the last result of the prev search is ': PROC'].


I have searched the string ': PROC' intially.

Now I am doing a new search with a different string. When I am trying to FIND the string 'END PARANAME', it's actually searching ': PROC'.

Hope this time it's more clear.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Wed Jul 13, 2011 5:26 pm    Post subject:
Reply with quote

Soumya Roy wrote:
Hope this time it's more clear.


no it is not.

Marso has suggested that your syntax sucks. (he did not say that, i am)

run the instruction with trace,
so that you can see what the resolution of
"ISREDIT FIND FIRST '(STR2FND)'"
is.

that will provide you with the info necessary to fix your own problem.
why are you using open '(' and closed ')' parenthesis?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Wed Jul 13, 2011 5:30 pm    Post subject:
Reply with quote

I am going to provide you with a hint:
"ISREDIT FIND FIRST '" STR2FND "'"
because I really don't want to see anymore of your responses,
other than 'I found the problem, it was ..., thank you Marso for your help'
Back to top
View user's profile Send private message
Soumya Roy

New User


Joined: 19 Feb 2009
Posts: 10
Location: Bangalore

PostPosted: Wed Jul 13, 2011 7:06 pm    Post subject: Reply to: Problem in Repeated FIND in ISPF Edit MACRO
Reply with quote

Yeah. Syntax was bad.

Running fine now.

Thanks both of you.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Wed Jul 13, 2011 7:13 pm    Post subject:
Reply with quote

thx for the feedback,
and we will be here in the event that you have a problem in the future,
or you see an opportunity where you can help someone that has a problem.

have a good week.

dbz
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1248
Location: Israel

PostPosted: Wed Jul 13, 2011 8:45 pm    Post subject: Reply to: Problem in Repeated FIND in ISPF Edit MACRO
Reply with quote

You're welcome.

Here are a couple of tips for macro writers:
  • If most of the external commands (and I mean external to REXX) are sent to the editor,
    code Address ISREDIT as the first line of the macro.
    then you can use edit commands without prefixing each of them.
  • It is very important to check the return code after each command.

Here is an example:
Code:
/* REXX */
Trace O

Address ISREDIT
'MACRO (fstring)'
QP=Pos("'",fstring)
Select
   When QP=1  Then Quote=''
   When QP<>0 Then Quote='"'
   Otherwise       Quote="'"
End

LblLst = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
Lbl1 = 1
Lbl2 = 0

'FIND FIRST 'Quote||fstring||Quote
If RC <> 0 Then Do
   ZEDSMSG = 'Field not found'
   ZEDLMSG = 'The field you specified was not found'
   Address ISPEXEC 'SETMSG MSG(ISRZ000)'
   Exit 4
End
'LABEL .ZCSR = .T'MakeLabel()' 0'

Do Forever
   'RFIND'
   If RC <> 0 Then Leave
   'LABEL .ZCSR = .T'MakeLabel()' 0'
End

'LOCATE .TAA'
Exit


MakeLabel:
   Lbl2 = Lbl2 + 1
   If Lbl2 > 26 Then Do
      Lbl1 = Lbl1 + 1
      Lbl2 = 1
   End
   MyLbl = Substr(LblLst,Lbl1,1) || Substr(LblLst,Lbl2,1)
Return MyLbl
I can't remember where this macro come from (maybe I wrote it, but I have doubts about this)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. ISREDIT Macro is not returning back t... nico_neoz CLIST & REXX 21 Sat Nov 18, 2017 7:40 pm
No new posts Having a problem FTP'ng to the MF pahiker All Other Mainframe Topics 2 Fri Nov 10, 2017 8:20 pm
No new posts MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts exec macro in the end of edit anatol CLIST & REXX 8 Fri Sep 22, 2017 5:10 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us