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
 
Read and display current line of file

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

New User


Joined: 15 May 2008
Posts: 41
Location: Chennai

PostPosted: Tue Mar 02, 2010 3:15 pm    Post subject: Read and display current line of file
Reply with quote

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
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 02, 2010 3:32 pm    Post subject:
Reply with quote

Click HERE to read the manual that will show you how.
Back to top
View user's profile Send private message
saagu

New User


Joined: 15 May 2008
Posts: 41
Location: Chennai

PostPosted: Tue Mar 02, 2010 3:39 pm    Post subject: Reply to: Read and display current line of file
Reply with quote

Can you give me a small hint on this...(just a keyword to be used will suffice....)
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 02, 2010 3:46 pm    Post subject:
Reply with quote

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
View user's profile Send private message
saagu

New User


Joined: 15 May 2008
Posts: 41
Location: Chennai

PostPosted: Tue Mar 02, 2010 5:02 pm    Post subject:
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 02, 2010 5:19 pm    Post subject:
Reply with quote

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
View user's profile Send private message
saagu

New User


Joined: 15 May 2008
Posts: 41
Location: Chennai

PostPosted: Tue Mar 02, 2010 6:03 pm    Post subject: Reply to: Read and display current line of file
Reply with quote

Now changed it to


ADDRESS ISREDIT (LINE) = CURSOR
ADDRESS ISPEXEC
SAY 'LINE:' LINE


Still the problem persists.... icon_cry.gif

Also tried,
ADDRESS ISREDIT (KINE) = CURSOR
ADDRESS ISPEXEC
SAY 'KINE:' KINE
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 02, 2010 6:16 pm    Post subject:
Reply with quote

Post the complete code for the edit macro, and please use the vb code tags.
Back to top
View user's profile Send private message
saagu

New User


Joined: 15 May 2008
Posts: 41
Location: Chennai

PostPosted: Tue Mar 02, 2010 6:22 pm    Post subject:
Reply with quote

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
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Tue Mar 02, 2010 6:52 pm    Post subject: Reply to: Read and display current line of file
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 02, 2010 7:06 pm    Post subject:
Reply with quote

And have you noticed a subtle difference between the ISREDIT statements before the last one.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1243
Location: Israel

PostPosted: Tue Mar 02, 2010 7:14 pm    Post subject:
Reply with quote

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
View user's profile Send private message
saagu

New User


Joined: 15 May 2008
Posts: 41
Location: Chennai

PostPosted: Wed Mar 03, 2010 10:47 am    Post subject:
Reply with quote

Its working now.....Thank you.....
Back to top
View user's profile Send private message
saagu

New User


Joined: 15 May 2008
Posts: 41
Location: Chennai

PostPosted: Wed Mar 03, 2010 11:17 am    Post subject:
Reply with quote

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
View user's profile Send private message
saagu

New User


Joined: 15 May 2008
Posts: 41
Location: Chennai

PostPosted: Wed Mar 03, 2010 12:13 pm    Post subject:
Reply with quote

I found the solution....used FIND_COUNTS to find the count after FIND
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 683
Location: Pennsylvania

PostPosted: Wed Mar 03, 2010 11:24 pm    Post subject:
Reply with quote

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
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
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Comparing 2 Files using Current time arunsoods DFSORT/ICETOOL 7 Fri Sep 22, 2017 6:00 pm
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm

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