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: 4648
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: 1219
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: 645
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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