samurai007 wrote:Could you tell me how to make it an ISPF Edit Macro ?
1. You need to determine what library or libraries are used at your site for user-written ISPF Edit macros. If you want to write your macro in REXX or CLIST, then the library(ies) need(s) to be allocated to your SYSPROC or SYSEXEC DD's for your TSO session.
2. One you know #1, then create the member RECCNT in that library.
3. Presuming you want to code your macro in REXX, you need the /*REXX*/ statement first. Next, to identify the code as an ISPF Edit macro, you need the "ISREDIT MACRO" statement.
4. I presume that, as a user of ISPF that you're familiar with the concept of the Editor-assigned labels like .zfirst, .zlast, etc:22.214.171.124 Editor-Assigned Labels
Since .zlast contains the line number of the last data line, then all you need to do is get and display its value:
"ISREDIT (last) = LINENUM .zlast" 3.3.48 LINENUM--Query the Line Number of a Labeled Line
zedsmsg = 'Count:'Strip(last,L,'0')' Lines'
zedlmsg = 'Count:'Strip(last,L,'0')' Lines'
"ISPEXEC SETMSG MSG(ISRZ001)" 126.96.36.199 Edit Macro Messages