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
 

 

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: 4649
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: 1232
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: 669
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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