MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

REXX ISPF edit macro dialog for managing your labels

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Tue Dec 03, 2002 2:47 am    Post subject: REXX ISPF edit macro dialog for managing your labels Reply with quote

Here's a simple but useful edit macro I wrote to keep track of labels in source code.

Type LABS on the command line to display current labels, select the row to jump to that label. Type LABS I with the cursor positioned to a line to insert a tokenized label.

Feel free to issue an info message if no labels exist, I am a bit lazy with things like that !

REXX edit macro code:

Code:

/* REXX ---------------------------------------------------------------

   Displays current labels in a pop-up panel

   To insert a tokenized label type LABS <parm> where parm is any char
   and position the cursor to the line where you want the label inserted

  --------------------------------------------------------------------*/

  address 'ISREDIT'

  "MACRO (ACT)"

  "(USRSTAT) = USER_STATE"

  upper act

  "(ROW,COL) = CURSOR"

  "(LINEDTA) = LINE .ZCSR"

  if ( act <> '' ) then do
    label_token = right( time( 'S' ), 5, 0 )
    if row > 0 then do
       label = right( translate( label_token, ,
                                 'ABCDEFGHIJ', '0123456789' ), 5 )
       'LABEL' row ' = .'label' 0'
       exit
    end
  end


  "LOCATE .ZF"

  "LOCATE FIRST LABEL"

  LabelSelected = 0

  if rc = 0 then do
    call DisplayLabels
  end

  if ^ LabelSelected then do
    "USER_STATE = (USRSTAT)"
  end

  exit

DisplayLabels:

  /* Create the display table */
  address 'ISPEXEC' "TBCREATE LABTAB NAMES(LABEL ROW LINEDATA)" ,
                                    "NOWRITE REPLACE"

  do forever
    /* Set the display data */
    "(ROW,COL)  = DISPLAY_LINES"
    "(LABEL)    = LABEL" row
    "(LINEDATA) = LINE" row
    /* Add the data to the display table */
    address 'ISPEXEC' "TBADD LABTAB"
    /* Locate the next label */
    "LOCATE LABEL"
    if rc > 0 then leave
  end

  address 'ISPEXEC'

  "ADDPOP"

  "TBTOP LABTAB"

  ztdtop = 0

  do forever
    /* Display the table */
    "TBSKIP  LABTAB NUMBER("ztdtop")"
    "TBDISPL LABTAB PANEL(LABPAN)"
    if rc > 4 then leave
    if LineOpt <> '' then do
      LabelSelected = 1
      address 'ISREDIT' "LOCATE" Label
      leave
    end
  end

  "REMPOP"

  "TBEND LABTAB"

  return



Here's the DTL for the panel, which you will need to generate because of the hex characters. Just type TSO ISPDTLC, fill in the fields etc.

Code:

<!doctype dm system ()>                               
                                                       
<varclass name=zcmdCls  type='char 40'>               
  <xlatl format=upper></xlatl>                         
                                                       
<varlist>                                             
  <vardcl name=zcmd     varclass=zcmdCls>             
</varlist>                                             
                                                       
<panel name=labpan                                     
       window=yes                                     
       wintitle='Select a label'                       
       depth=22                                       
       width=70>                                       
                                                       
<cmdarea>                                             
                                                       
<topinst>                                             
Select the row to locate the label.                   
                                                       
<area>                                                 
                                                       
<lstfld scrollvar=tbscrl>                             
  <lstcol datavar=lineopt  usage=in  entwidth=1>       
  <lstcol datavar=label    usage=out entwidth=6>Label 
  <lstcol datavar=row      usage=out entwidth=8>Line   
  <lstcol datavar=LineData usage=out entwidth=46>Data 
</lstfld>                                             
                                                       
</area>                                               
</panel>                                               

_________________
Dave Crayford
Back to top
View user's profile Send private message Send e-mail
faisal
Beginner


Joined: 05 Dec 2002
Posts: 8
Topics: 1

PostPosted: Fri Dec 27, 2002 1:28 pm    Post subject: Reply with quote

GREAT ! i was going to code this thing myself because i always felt i needed something like this. Thanks for posting it. Will save me a ton of time.

Faisal
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group