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
 

 

To Get The line Number where the Cursor is at

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

New User


Joined: 29 May 2007
Posts: 16
Location: bangalore

PostPosted: Wed Aug 08, 2007 5:27 pm    Post subject: To Get The line Number where the Cursor is at
Reply with quote

Hi All,
i have written the following code to obtain the Line no. where the Cursor is at.
Code:
/*+--------------------------REXX------------------------------------+*/
/*| This EDIT macro will find at which line the cursor is            |*/
/*+------------------------------------------------------------------+*/
     ADDRESS ISREDIT                                                   
     "MACRO PROCESS"                                                   
                                                                       
/*   TRACE R  */                                                       
                                                                       
     ADDRESS ISPEXEC "CONTROL ERRORS RETURN"                           
                                                                       
     ISREDIT (WHERE) = CURSOR                                           
     SAY 'CUSRSOR IS AT' &WHERE                                         

but i am geting following error
Code:
     12 +++ SAY 'CUSRSOR IS AT' &WHERE                               
 IRX0034I Error running BEGIN, line 12: Logical value not 0 or 1     
 ***                                                                 


Begin is the Command I am giving. Its a Memebr of a PDS that PDS i have concatenated with the SYSPROC library.

Please help me
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Aug 08, 2007 5:49 pm    Post subject:
Reply with quote

Remove the '&' from the SAY. REXX considers '&' as a logical "and", and therefor it looks for a logical value.

O.
Back to top
View user's profile Send private message
ironmike

New User


Joined: 07 Aug 2005
Posts: 33

PostPosted: Thu Aug 09, 2007 4:43 am    Post subject: Re: To Get The line Number where the Cursor is at
Reply with quote

I changed yours a little; you are using 'SAY' to write the output, which switches from TSO fullscreen mode to line mode, then you have to hit ENTER to remove the '***' that is displayed and get back to the ISPF EDIT screen. The version below uses an ISPF SETMSG service call instead of a REXX SAY to display the line number on the ISPF message line, and eliminates leading zeros from the line number also.

Code:
/*REXX*/
Address ISREDIT
"MACRO PROCESS"
Address ISPEXEC "CONTROL ERRORS RETURN"
"ISREDIT (WHERE) = CURSOR"
zedsmsg = ''
zedlmsg = 'Cursor is on line 'Strip(where,'L',0)
Address ISPEXEC "SETMSG MSG(ISRZ000)"
Exit 0
Code:

Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Aug 09, 2007 12:18 pm    Post subject:
Reply with quote

You can change
Code:
zedlmsg = 'Cursor is on line 'Strip(where,'L',0)


to
Code:
zedlmsg = 'Cursor is on line 'where+0


O.
Back to top
View user's profile Send private message
rakesh pattanayak

New User


Joined: 29 May 2007
Posts: 16
Location: bangalore

PostPosted: Thu Aug 09, 2007 5:07 pm    Post subject: Re: To Get The line Number where the Cursor is at
Reply with quote

In Connection to this i have one requirement .
it is like when i will give a command in command line and i will put my cursor
in a line.then following line should be added after that line where the cursor was

****<today's date(MM/DD/YY) > <My Name> Begin****


. for that i wrote this but its not workING
Code:

/*REXX*/                                                       
Address ISREDIT                                                 
"MACRO PROCESS"                                                 
Address ISPEXEC "CONTROL ERRORS RETURN"                         
"ISREDIT (WHERE) = CURSOR"                                     
SET LINE = (WHERE)                                             
ISREDIT (SRCLIB) = DATASET                                     
SET SRC = &STR(')&SRCLIB&STR(')                                 
SET OUTSTR = &STR(+                                             
****DATE('U')    RAKESH                          BEGIN****)     
ISREDIT LINE_AFTER &LINE = (OUTSTR)                             
SET LINE = &LINE + 1

please help me.
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: Thu Aug 09, 2007 7:54 pm    Post subject:
Reply with quote

Why are you using CLIST language in a REXX
Back to top
View user's profile Send private message
ironmike

New User


Joined: 07 Aug 2005
Posts: 33

PostPosted: Thu Aug 09, 2007 7:57 pm    Post subject:
Reply with quote

OK, several things:

    You are using & as a prefix on your REXX variables. CLIST language variables use & as a prefix, REXX variables DON'T. Get rid of the '&' prefix on your REXX variable names
    You don't need ISPEXEC CONTROL ERRORS RETURN on an edit macro, unless you are doing something critical, which you are not.


I redid the macro, it now does what you asked for above.
Code:

 /*REXX*/                                 
 Address ISREDIT                           
 "MACRO PROCESS"                           
 "ISREDIT (WHERE) = CURSOR"               
 LINEDATA = '**** '||Date('U')||' Rakesh '
 "LINE_AFTER "WHERE" = DATALINE (LINEDATA)"
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 Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts how to mask the phone number kumarinfy DB2 4 Mon Apr 03, 2017 5:23 pm
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm


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