Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

ISREDIT macro command doubt
Goto page 1, 2, 3, 4  Next
 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Wed Feb 05, 2014 6:47 pm    Post subject: ISREDIT macro command doubt
Reply with quote

Hi all,
I am creating a rexx macro now and for that i am using isredit find command to find the particular string in a jcl and getting the dataset by using the string....but now what happened is the string is present in more than one more place so each time when the string is found it should get the dataset and move it to the stem variable...i found the string once and now the string is present in line number 12 and i have to move my cursor position to line number 12 from the present cursor position which is 6....how can i move the cursor position after each find statement....

Title de-emphasised
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Feb 05, 2014 6:49 pm    Post subject: Reply to: ISREDIT MACRO COMMAND DOUBT...URGENT...!!!!!
Reply with quote

unfortunately nobody does URGENT around here

if You have time constraints a forum is not the best place to ask for help

and ... do not use CAPS in the title of the topic, it' s like shouting
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Wed Feb 05, 2014 6:59 pm    Post subject: Reply to: ISREDIT MACRO COMMAND DOUBT...URGENT...!!!!!
Reply with quote

Quote:
how can i move the cursor position after each find statement

How do you do it when you are normally editing a dataset. Have you referred to the macro manual?
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Wed Feb 05, 2014 10:07 pm    Post subject: Reply to: ISREDIT MACRO COMMAND DOUBT...URGENT...!!!!!
Reply with quote

Are you saying that the cursor does not move after the second FIND?

Show us your macro.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Fri Feb 07, 2014 12:57 pm    Post subject:
Reply with quote

First of all Sorry for giving the subject in caps...i have been trying to find out the solution for 2 days regarding but dint get a solution....
Code:

/*REXX*/
"ISREDIT MACRO"
TRACE (?R)
TEMP="NEW,CATLG,DELETE"
I=1
"ISREDIT SEEK  ALL '"TEMP"'"
"ISREDIT (COUNT) = SEEK_COUNTS"
SAY COUNT
DO WHILE COUNT > 0
IF RC=0 THEN DO
"ISREDIT (VAL) = LINENUM .ZCSR"
VAL1=VAL-1
"ISREDIT CURSOR = "VAL1" 1"
"ISREDIT (LINE) = LINE .ZCSR"
      INPUT.I = STRIP(LINE)
      PARSE VALUE "'"INPUT.I"'" WITH PREC ','
       OUT=POS('=',PREC)
       RES=SUBSTR(PREC,OUT+1)
       OUTPUT.I=RES
 "ISREDIT FIND NEXT '"TEMP"'"
COUNT=COUNT-1
 END
 "ISREDIT END"



here is my macro.....after the FIND NEXT command.....when the loop again starts the cursor position is in the same place it dint move to next position after the string is again present......

Code'd
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7224

PostPosted: Fri Feb 07, 2014 1:20 pm    Post subject: Reply to: ISREDIT macro command doubt
Reply with quote

COUNT is controlling your loop. How do you feel there is a connection between COUNT (a Varible) and FIND?

To put it another way, when you FIND what happens to COUNT? Nothing.

It is good to use the trace and post it.

Work on your indentation.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Fri Feb 07, 2014 2:06 pm    Post subject:
Reply with quote

I have COUNT here as loop since it will tell the number of times the string is present and so the process of finding the string and performing operation on that line will happen according to the number of the times the string is present....Now how can i move the cursor to the next line where the string is again present what code should i write for that after the NEXT FIND syntax line....
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Fri Feb 07, 2014 2:08 pm    Post subject: Re: Reply to: ISREDIT MACRO COMMAND DOUBT...URGENT...!!!!!
Reply with quote

Pedro wrote:
Are you saying that the cursor does not move after the second FIND?

Show us your macro.


/*REXX*/
"ISREDIT MACRO"
TRACE (?R)
TEMP="NEW,CATLG,DELETE"
I=1
"ISREDIT SEEK ALL '"TEMP"'"
"ISREDIT (COUNT) = SEEK_COUNTS"
SAY COUNT
DO WHILE COUNT > 0
IF RC=0 THEN DO
"ISREDIT (VAL) = LINENUM .ZCSR"
VAL1=VAL-1
"ISREDIT CURSOR = "VAL1" 1"
"ISREDIT (LINE) = LINE .ZCSR"
INPUT.I = STRIP(LINE)
PARSE VALUE "'"INPUT.I"'" WITH PREC ','
OUT=POS('=',PREC)
RES=SUBSTR(PREC,OUT+1)
OUTPUT.I=RES
"ISREDIT FIND NEXT '"TEMP"'"
COUNT=COUNT-1
END
"ISREDIT END"
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Fri Feb 07, 2014 2:55 pm    Post subject:
Reply with quote

Hi... I guess you are trying to get list of Datasets that are getting created in the JOB.

Code:
"ISREDIT (VAL) = LINENUM .ZCSR"
VAL1=VAL-1
"ISREDIT CURSOR = "VAL1" 1"
Because of the above statement, Cursor move to Previous line and when you issue "FIND NEXT", it will go the same line again and again. If you haven't specified loop based on count, it would've been a infinite icon_rolleyes.gif .

When you use "FIND" command in your EXEC, its better to avoid change the place of cursor.

if you want to get the previous line data, you can easily get by LINENUM.
So, remove
Code:
"ISREDIT CURSOR = "VAL1" 1"
"ISREDIT (LINE) = LINE .ZCSR"
and code
Code:
"ISREDIT (LINE) = LINE " VAL1


Hope this helps icon_razz.gif
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Fri Feb 07, 2014 5:16 pm    Post subject:
Reply with quote

sureshpathi10 wrote:
Hi... I guess you are trying to get list of Datasets that are getting created in the JOB.

Code:
"ISREDIT (VAL) = LINENUM .ZCSR"
VAL1=VAL-1
"ISREDIT CURSOR = "VAL1" 1"
Because of the above statement, Cursor move to Previous line and when you issue "FIND NEXT", it will go the same line again and again. If you haven't specified loop based on count, it would've been a infinite icon_rolleyes.gif .

When you use "FIND" command in your EXEC, its better to avoid change the place of cursor.

if you want to get the previous line data, you can easily get by LINENUM.
So, remove
Code:
"ISREDIT CURSOR = "VAL1" 1"
"ISREDIT (LINE) = LINE .ZCSR"
and code
Code:
"ISREDIT (LINE) = LINE " VAL1


Hope this helps icon_razz.gif




Hi,
Thanks a lot sureshpathi.......it was really helpful for me.....i got my code executed correct...thank you so much..... icon_lol.gif icon_lol.gif icon_smile.gif
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue Feb 11, 2014 3:06 pm    Post subject:
Reply with quote

Hi
I want to find the string "NEW,CATLG,DELETE" or ",CATLG,DELETE" in a jcl...How do i write the syntax using the find command to find either this or that.....
Back to top
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 982
Location: Oostende, Belgium

PostPosted: Tue Feb 11, 2014 4:23 pm    Post subject:
Reply with quote

Swathi Muralidharan wrote:
Hi
I want to find the string "NEW,CATLG,DELETE" or ",CATLG,DELETE" in a jcl...How do i write the syntax using the find command to find either this or that.....


"isredit find 'either this or that'"
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue Feb 11, 2014 5:25 pm    Post subject:
Reply with quote

prino wrote:
Swathi Muralidharan wrote:
Hi
I want to find the string "NEW,CATLG,DELETE" or ",CATLG,DELETE" in a jcl...How do i write the syntax using the find command to find either this or that.....


"isredit find 'either this or that'"


Sorry i count understand what you wrote....
I have taken TEMP="NEW,CATLG,DELETE" and TEMP2 = ",CATLG,DELETE"
if in this i have find all either TEMP or TEMP2
then do i need to write like this
"ISREDIT FIND ALL '"TEMP"' OR '"TEMP2"' "
Is my above syntax correct.....?????

If not please provide me the right syntax.....
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue Feb 11, 2014 5:29 pm    Post subject:
Reply with quote

Swathi Muralidharan wrote:
prino wrote:
Swathi Muralidharan wrote:
Hi
I want to find the string "NEW,CATLG,DELETE" or ",CATLG,DELETE" in a jcl...How do i write the syntax using the find command to find either this or that.....


"isredit find 'either this or that'"


Sorry i count understand what you wrote....
I have taken TEMP="NEW,CATLG,DELETE" and TEMP2 = ",CATLG,DELETE"
if in this i have find all either TEMP or TEMP2
then do i need to write like this
"ISREDIT FIND ALL '"TEMP"' OR '"TEMP2"' "
Is my above syntax correct.....?????

If not please provide me the right syntax.....


I am getting error for the above syntax of ISREDIT.....please help me with the right syntax for that....
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue Feb 11, 2014 5:30 pm    Post subject:
Reply with quote

I have taken TEMP="NEW,CATLG,DELETE" and TEMP2 = ",CATLG,DELETE"
if in this i have to find all either TEMP or TEMP2 and have a count of all those and perform operations
so I wrote like this
"ISREDIT FIND ALL '"TEMP"' OR '"TEMP2"' "
bu i am getting error in this line....please help me with the right code for this....
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Feb 11, 2014 5:47 pm    Post subject: Reply to: ISREDIT macro command doubt
Reply with quote

Quote:
"ISREDIT FIND ALL '"TEMP"' OR '"TEMP2"' "
bu i am getting error in this line....please help me with the right code for this....


You should realize that just whining about getting an error is only a waste of time for everybody

unless You post more useful info ...
the EXACT code snippet
the EXACT error You received

and a trace of the execution of the relevant statements
Your chances of getting help are pretty slim
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Tue Feb 11, 2014 8:00 pm    Post subject: Reply to: ISREDIT macro command doubt
Reply with quote

FIND does not support a syntax of finding two different strings. You have to find each of string1 then start over at the top and find each of string2.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue Feb 11, 2014 8:51 pm    Post subject: Re: Reply to: ISREDIT macro command doubt
Reply with quote

Pedro wrote:
FIND does not support a syntax of finding two different strings. You have to find each of string1 then start over at the top and find each of string2.


Hi,
Yes i found that and used two different call statement to call each time like when it finds temp1 it calls one program and when it finds temp2 it calls the other program.

But now i want to find whether the dataset which i am finding is a GDG or a ps file...if it is GDG then i have to iterate through the loop.

is there any syntax to find the character in a line....please help with that....

My idea is to find whether the dataset is GDG or ps is if that dataset contains "(" or ")" then i can determine that it is a GDG so that i will iterate through the loop.

can someone help me giving some idea regarding that.....
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Feb 11, 2014 8:58 pm    Post subject: Reply to: ISREDIT macro command doubt
Reply with quote

Quote:
My idea is to find whether the dataset is GDG or ps is if that dataset contains "(" or ")"


and only if the thing between parentheses is a number

it could be a PDS with a member specified ( SOME.PDS(MEMBER) )
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue Feb 11, 2014 9:36 pm    Post subject:
Reply with quote

Yes you are right if i find the character between "(" and ")" i can find whether it is numeric or character using DATATYPE syntax...but how do I find the character between both the paranthesis......??????
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts Doubt in MFS abdulrafi IMS DB/DC 2 Fri Oct 21, 2016 3:09 pm
No new posts SDSF Command Avtrix CLIST & REXX 4 Fri Sep 30, 2016 11:13 am
No new posts How to find a CICS resource used in C... Arunkumar Chandrasekaran CICS 8 Thu Sep 29, 2016 1:45 pm
No new posts COMPARE command sivatechdrive TSO/ISPF 7 Fri Sep 16, 2016 4:31 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us