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
 

 

How to read current line via a macro

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

New User


Joined: 01 Sep 2007
Posts: 11
Location: Baltimore, MD US

PostPosted: Sat Sep 01, 2007 12:52 am    Post subject: How to read current line via a macro
Reply with quote

My requirement is to read the current line using a macro. I have written the following code, but its not working.

/*************************** REXX *************************/
"ISPEXEC CONTROL NONDISPL ENTER"
ADDRESS ISREDIT
"ISREDIT MACRO"
"ISREDIT (LINER) = LINE .ZCSR"
SAY LINER

Output: LINER
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: Sat Sep 01, 2007 1:19 am    Post subject:
Reply with quote

Try

"ISREDIT (CRSLINE,CRSCOL) = CURSOR"

Where CRSLINE gives the line number and CRSCOL gives the column location

Rather nicely documented in the manual
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Sep 01, 2007 1:33 am    Post subject:
Reply with quote

instead of this:
"ISREDIT (LINER) = LINE .ZCSR"
use this
"ISREDIT (LINER) = LINE" .ZCSR

.zcsr should not be in the quotes.
Back to top
View user's profile Send private message
dvpkumar217

New User


Joined: 01 Sep 2007
Posts: 11
Location: Baltimore, MD US

PostPosted: Sat Sep 01, 2007 1:38 am    Post subject: How to read current line thru REXX?
Reply with quote

Its not working still... even after

"ISREDIT (LINER) = LINE" .ZCSR

Thanks
Pavan.
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: Sat Sep 01, 2007 1:49 am    Post subject:
Reply with quote

What is the error message, please post what you are seeing at the point of failure
Back to top
View user's profile Send private message
dvpkumar217

New User


Joined: 01 Sep 2007
Posts: 11
Location: Baltimore, MD US

PostPosted: Sat Sep 01, 2007 1:51 am    Post subject: How to read current line thru REXX?
Reply with quote

It says: LINER

Expected output: Current line in a PS.

Thanks
Pavan.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Sep 01, 2007 1:55 am    Post subject:
Reply with quote

Code:

/*  REXX  */
ADDRESS ISREDIT
"MACRO"
"ISREDIT(LINER) = LINE" .ZCSR
SAY LINER


and use Trace

TRACE ?R
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: Sat Sep 01, 2007 1:59 am    Post subject:
Reply with quote

"ISREDIT (CRSLINE,CRSCOL) = CURSOR"
"ISREDIT (LINEDATA) = LINE " CRSLINE

Has always worked for me.

Once the cursor has been positioned on a line by a F 'whatever' command, I use the above code and LINEDATA contains the line from the dataset.

The fact that your output shows 'LINER' suggests that the variable is uninitialised. Are you running batch or foreground.
Back to top
View user's profile Send private message
dvpkumar217

New User


Joined: 01 Sep 2007
Posts: 11
Location: Baltimore, MD US

PostPosted: Sat Sep 01, 2007 2:05 am    Post subject: How to read current line thru REXX?
Reply with quote

Thanks for your quick response.

But I am not aware of TRACE. What is TRACE and how is it used?

My actual requirement is:

I have to display the current line (where the cursor is positioned) in a PDS member. So I will be giving the EXEC command in the command line, place the cursor at the required line in a PDS Member and hit an enter. The expected output is that line where the cursor is present.

Please let me know if there is any other better way to achieve this.

Thanks,
Pavan.
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: Sat Sep 01, 2007 2:18 am    Post subject:
Reply with quote

OK, I am somewhat baffled by the reason for performing this task.

Dare I ask if this is a HOMEWORK or project type question. Because if it is - Please do not post these questions on the forum. We are here to help people not to do their homework for them.
Back to top
View user's profile Send private message
dvpkumar217

New User


Joined: 01 Sep 2007
Posts: 11
Location: Baltimore, MD US

PostPosted: Sat Sep 01, 2007 2:21 am    Post subject: How to read current line thru REXX?
Reply with quote

I am really sorry, if I have asked you so many questions.

But, I am not sitting here to do any homework... Please help me if you know.

I am generating a tool for my company.

Thanks,
Pavan.
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: Sat Sep 01, 2007 2:29 am    Post subject:
Reply with quote

Well, as Dick has said - run with TRACE ?R as the very first line of code after the REXX first line. Or use TRACE I for even more detail.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Sep 01, 2007 2:31 am    Post subject:
Reply with quote

Hello,

Quote:
What is TRACE and how is it used?


TRACE is a diagnostic aid and will show you what is going on in the code.
Back to top
View user's profile Send private message
dvpkumar217

New User


Joined: 01 Sep 2007
Posts: 11
Location: Baltimore, MD US

PostPosted: Sat Sep 01, 2007 2:42 am    Post subject: How to read current line thru REXX?
Reply with quote

Thanks for the help. I could use TRACE.

But RC(20) is being returned at

"ISREDIT MACRO"

and

"ISREDIT (LINER) = LINE" .ZCSR

I am not sure why??

Thanks for your help and patience.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Sep 01, 2007 3:11 am    Post subject:
Reply with quote

are you in an edit or view session when executing the macro?
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: Sat Sep 01, 2007 3:41 am    Post subject:
Reply with quote

Try

ADDRESS TSO

instead of ADDRESS ISREDIT
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. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts CICS VSAM RLS READ akodakka CICS 3 Tue Oct 04, 2016 3:09 pm
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm
No new posts Multi row fetch - "for read only... Nileshkul DB2 3 Sun Aug 14, 2016 12:52 am
No new posts PCOMM macro to call another PCOMM macro boyti ko All Other Mainframe Topics 4 Tue Jul 12, 2016 4:30 pm


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