Monday, September 26, 2011

SUPERC: How to exclude commented lines from search

The below job excludes the commented lines from the search.

//SEARCH  EXEC PGM=ISRSUPC,                                           *
//            PARM=(SRCHCMP,                                           
//            'ANYC')                                                  
//NEWDD  DD *                                                           
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
      * COMMENTED LINE                                                 
        NORMAL LINE                                                    
LINE    NORMAL                                                          
//OUTDD  DD SYSOUT=(A)                                                 
//SYSIN  DD *                                                          
CMPCOLM 7:71                                                           
DPLINE  '*',7                                                          
SRCHFOR  'LINE'                                                        
/*  

CMPCOLM instructs SUPERC to search between 7 and 71th column
DPLINE instructs not to process lines that are having "*" at the 7th column

The output of the above job will be 2nd record.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.