products/sources/formale sprachen/REXX image not shown  

Quellcode-Bibliothek

© Kompilation durch diese Firma

[Weder Korrektheit noch Funktionsfähigkeit der Software werden zugesichert.]

Datei: ZONLY.REXX   Sprache: REXX

Original von: REXX©

/* Rexx **************************************************************/         
/***** Sample Edit Macro *********************************************/         
/*********************************************************************/         
/*                                                                   */         
/* The ONLY macro is a combination of EXCLUDE and FIND such that     */         
/* "only" the lines containing the search string will be displayed.  */         
/* The parameters for ONLY are the same as those for the FIND        */         
/* command with the exception of FIRST, LAST, NEXT, and PREV.        */         
/*                                                                   */         
/*********************************************************************/         
Trace                                                                           
Address ispexec                                                                 
                                                                                
'ISREDIT MACRO (FNDPARM)'                                                       
'CONTROL ERRORS RETURN'              /* Clist handles ISPF and PDF              
                                        return codes greater than 12 */

'ISREDIT (RECFM) = RECFM'            /* Request record format        */         
'ISREDIT (NUMMODE,NUMTYPE) = NUMBER' /* Request number mode info     */         
                                                                                
Parse Var numtype std cobol display  /* NUMBER returns a string of 3            
                                        words for the second value.  We         
                                        need to parse NUMTYPE into its          
                                        3 parts.                     */

If nummode = 'ON' Then                                                          
  Do                                                                            
  /************************************************************/                
  /* Number mode on can cause a mismatch between col numbers  */                
  /* known to the user and to this macro if there are         */                
  /* sequence numbers at the beginning of the line.  To avoid */                
  /* the confusion number mode is turned off while the macro  */                
  /* runs. Doing this can cause the bounds to change to       */                
  /* include the line numbers if the bounds were originally   */                
  /* set to the default. Therefore if they change the macro   */                
  /* must override that change to prevent the search from     */                
  /* including the line numbers.                              */                
  /************************************************************/                
    If recfm = 'V' ! cobol = 'COBOL' Then                                       
      Do                             /* These types have seq numbers at         
                                        the beginning of the record. */

        'ISREDIT (LEFTON,RIGHTON) = BOUNDS' /* Note the current bounds          
                                                                     */

        'ISREDIT NUMBER OFF'         /* Set number mode off.  This may          
                                        cause the left bound to move.*/

        'ISREDIT (LEFTOFF,RIGHTOFF) = BOUNDS' /* Note where the bounds          
                                        are now                      */

        If leftoff = 1 Then                                                     
          Do                         /* Number mode would not have              
                                        allowed a left bound within the         
                                        seq num, therefore a value of 1         
                                        means it was changed by the             
                                        NUMBER OFF, indicating default          
                                        bounds                       */

            lefton = ' '             /* Blank the values to be       */         
            righton = ' '            /* restored to cause defaults   */         
                                     /* to be restored               */         
            If recfm = 'V' Then                                                 
              'ISREDIT BOUNDS = 9 *' /* Override the left bound to              
                                        exclude the seq number       */

            Else                     /* RECFM = F, therefore must be */         
              Do                        cobol line numbers           */         
                If std='STD' Then                                               
                  Do                 /* Cobol may have sequence numbers         
                                        at the end in addition to the           
                                        beginning                    */

                    'ISREDIT (LRECL) = LRECL' /* Right bound depends on         
                                        record length                */

                    'ISREDIT BOUNDS = 7' lrecl-8                                
                                         /* Override both bounds */             
                  End                                                           
                Else                                                            
                  'ISREDIT BOUNDS = 7 *' /* For NOSTD override only the         
                                        left                         */

              End                                                               
          End                                                                   
      End                                                                       
  End                                                                           
                                                                                
If substr(fndparm,1,1) ^= "'" &,                                                
   substr(fndparm,1,1) ^= '"' Then   /* Not already a quoted string  */         
  If pos("'",fndparm) ^= 0 Then      /* Single quote in parm string  */         
    fndparm = '"'fndparm'"'          /* Put find string in double               
                                        quotes                       */

  Else                               /* No single quotes found       */         
    fndparm = "'"fndparm"'"          /* Put find string in single               
                                        quotes                       */

                                                                                
'ISREDIT SEEK' fndparm 'FIRST'       /* First see if there is a string          
                                                                     */

If rc = 0 Then                                                                  
  Do                                 /* If so, exclude all lines     */         
    'ISREDIT EXCLUDE ALL'                                                       
    'ISREDIT FIND' fndparm 'ALL'     /* Show only lines with the string         
                                                                     */

    onlyrc = 0                       /* Indicate success             */         
  End                                                                           
Else                                 /* If not, say so               */         
  Do                                                                            
    zedsmsg = 'String not found'                                                
    zedlmsg = '"'fndparm'" not found in the entire file'                        
    'SETMSG MSG(ISRZ001)'            /* Set message with alarm       */         
    onlyrc = 12                      /* Cause the cmd to remain on   */         
  End                                /* the PDF edit command line    */         
                                                                                
If nummode = 'ON' & (recfm = 'V' ! cobol = 'COBOL'Then                        
  Do                                 /* If number was turned off     */         
    'ISREDIT NUMBER = ('nummode','numtype')' /* Turn it back on and  */         
    'ISREDIT BOUNDS =' lefton righton /* Restore the bounds          */         
  End                                                                           
Exit onlyrc                                                                     

¤ Dauer der Verarbeitung: 0.45 Sekunden  (vorverarbeitet)  ¤





Download des
Quellennavigators
Download des
sprechenden Kalenders

in der Quellcodebibliothek suchen




Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.


Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.


Bot Zugriff