View previous topic :: View next topic
|
Author |
Message |
saagu
New User
Joined: 15 May 2008 Posts: 41 Location: Chennai
|
|
|
|
I want the macro program to locate the specified string and display the found line of data from the file. I've written the following code to accomplish the task. But, I'm unable to display the current line. Please let me know on how to display the current line.
Sample call: TSO Lend 1234
File: AAAAA.XXXXX.LIST.OLD:
1234 Wipro
5678 TCS
1235 GOOGLE
ABCD.PDS.REXX(Lend):
ARG IP
ADDRESS ISPEXEC "VPUT (IP) SHARED"
ADDRESS ISPEXEC "VIEW DATASET('AAAAA.XXXXX.LIST.OLD') MACRO(RECSMAC)"
ABCD.PDS.REXX(Recsmac):
ADDRESS ISREDIT "MACRO PROCESS"
ADDRESS ISREDIT "RES"
ADDRESS ISPEXEC "VGET IP"
ADDRESS ISREDIT "FIND &IP" |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Click HERE to read the manual that will show you how. |
|
Back to top |
|
|
saagu
New User
Joined: 15 May 2008 Posts: 41 Location: Chennai
|
|
|
|
Can you give me a small hint on this...(just a keyword to be used will suffice....) |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Well as I'm in a particularly good mood and you obviously can't be arsed to look for yourself.
One and only clue 3.3.16 but you will need another keyword / section to do what you want.
That I will leave for you to figure out. |
|
Back to top |
|
|
saagu
New User
Joined: 15 May 2008 Posts: 41 Location: Chennai
|
|
|
|
I have modified the macro code as per your suggestion:
ADDRESS ISREDIT "MACRO PROCESS"
ADDRESS ISREDIT "RES"
ADDRESS ISPEXEC "VGET IP"
ADDRESS ISREDIT "FIND &IP"
ADDRESS ISREDIT KINE = CURSOR
ADDRESS ISPEXEC
SAY 'KINE:' KINE
But its giving return code 20(severe error)
Can we use CURSOR in macro? Is that the problem? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
saagu wrote: |
But its giving return code 20(severe error) |
Perhaps if you would care to compare your syntax against that in the example shown in the manual you might see a subtle difference.
saagu wrote: |
Can we use CURSOR in macro? Is that the problem ? |
With the manual having the title "z/OS V1R9.0 ISPF Edit and Edit Macros" and the CURSOR section contained in the manual I would hazard a very very sure guess that YES you can use CURSOR in the macro. |
|
Back to top |
|
|
saagu
New User
Joined: 15 May 2008 Posts: 41 Location: Chennai
|
|
|
|
Now changed it to
ADDRESS ISREDIT (LINE) = CURSOR
ADDRESS ISPEXEC
SAY 'LINE:' LINE
Still the problem persists....
Also tried,
ADDRESS ISREDIT (KINE) = CURSOR
ADDRESS ISPEXEC
SAY 'KINE:' KINE |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Post the complete code for the edit macro, and please use the vb code tags. |
|
Back to top |
|
|
saagu
New User
Joined: 15 May 2008 Posts: 41 Location: Chennai
|
|
|
|
ABCD.PDS.REXX(Recsmac):
Code: |
ADDRESS ISREDIT "MACRO PROCESS"
ADDRESS ISREDIT "RES"
ADDRESS ISPEXEC "VGET IP"
ADDRESS ISREDIT "FIND &IP"
ADDRESS ISREDIT (LINE) = CURSOR
ADDRESS ISPEXEC
SAY 'LINE:' LINE |
Also tried using KINE in place of LINE but the problem is not solved |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Try this to figure out what options you want:
Code: |
/* REXX */
"ISREDIT MACRO"
"ISREDIT (line,column) = CURSOR"
"ISREDIT (data) = LINE .zcsr"
Say line column
Say data
Exit 0
|
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
And have you noticed a subtle difference between the ISREDIT statements before the last one. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
saagu wrote: |
ABCD.PDS.REXX(Recsmac):
Code: |
ADDRESS ISREDIT "MACRO PROCESS"
ADDRESS ISREDIT "RES"
ADDRESS ISPEXEC "VGET IP"
ADDRESS ISREDIT "FIND &IP"
ADDRESS ISREDIT (LINE) = CURSOR
ADDRESS ISPEXEC
SAY 'LINE:' LINE |
Also tried using KINE in place of LINE but the problem is not solved |
In your opinion, how important are the quotes used in the 4 first lines ?
And I'm curious, what is the ADDRESS ISPEXEC doing there ? |
|
Back to top |
|
|
saagu
New User
Joined: 15 May 2008 Posts: 41 Location: Chennai
|
|
|
|
Its working now.....Thank you..... |
|
Back to top |
|
|
saagu
New User
Joined: 15 May 2008 Posts: 41 Location: Chennai
|
|
|
|
Now the working code is:
ABCD.PDS.REXX(Recsmac):
Code: |
ADDRESS ISREDIT "MACRO PROCESS"
ADDRESS ISREDIT "RES"
ADDRESS ISPEXEC "VGET IP"
ADDRESS ISREDIT "FIND &IP"
ADDRESS ISREDIT "(LINE) = CURSOR"
ADDRESS ISREDIT "(DATA) = LINE .ZCSR"
SAY LINE
SAY DATA
ADDRESS ISREDIT "CANCEL" |
Now, after doing FIND in the above code, I want to know whether the search string is found or not. Based on the status(Found/Not found), I want to change my code to handle the situation. i.e., i want to know the key word variable where the execution status of FIND is stored. |
|
Back to top |
|
|
saagu
New User
Joined: 15 May 2008 Posts: 41 Location: Chennai
|
|
|
|
I found the solution....used FIND_COUNTS to find the count after FIND |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
You could also check the rc of the find command....
0 = found
4 = not found
Code: |
ADDRESS ISREDIT "FIND &IP"
findrc = rc
say 'findrc -' findrc
|
|
|
Back to top |
|
|
|