View previous topic :: View next topic
|
Author |
Message |
dvpkumar217
New User
Joined: 01 Sep 2007 Posts: 11 Location: Baltimore, MD US
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
instead of this:
"ISREDIT (LINER) = LINE .ZCSR"
use this
"ISREDIT (LINER) = LINE" .ZCSR
.zcsr should not be in the quotes. |
|
Back to top |
|
|
dvpkumar217
New User
Joined: 01 Sep 2007 Posts: 11 Location: Baltimore, MD US
|
|
|
|
Its not working still... even after
"ISREDIT (LINER) = LINE" .ZCSR
Thanks
Pavan. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
What is the error message, please post what you are seeing at the point of failure |
|
Back to top |
|
|
dvpkumar217
New User
Joined: 01 Sep 2007 Posts: 11 Location: Baltimore, MD US
|
|
|
|
It says: LINER
Expected output: Current line in a PS.
Thanks
Pavan. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Code: |
/* REXX */
ADDRESS ISREDIT
"MACRO"
"ISREDIT(LINER) = LINE" .ZCSR
SAY LINER
|
and use Trace
TRACE ?R |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
"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 |
|
|
dvpkumar217
New User
Joined: 01 Sep 2007 Posts: 11 Location: Baltimore, MD US
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
dvpkumar217
New User
Joined: 01 Sep 2007 Posts: 11 Location: Baltimore, MD US
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
dvpkumar217
New User
Joined: 01 Sep 2007 Posts: 11 Location: Baltimore, MD US
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
are you in an edit or view session when executing the macro? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Try
ADDRESS TSO
instead of ADDRESS ISREDIT |
|
Back to top |
|
|
|