On Fri, 7 Jan 2011 21:08:33 -0500, Rich Greenberg <ric...@panix.com> wrot
e:

>On: Fri, Jan 07, 2011 at 07:45:29PM +0300,Sergio Lima Wrote:
>
>} We have a program here, got from this list, that is very usefull for u
s.
>} Unfortunatelly I don't remember the author of this program, may be 
Kris...
>} This program is wrote using PIPE command, and FIND all CALL 
instructions in all programas with FILETYPE of COBOL.
>} We already use this same program for FIND the EXEC commands in all JCL
 
here, and run very well.
>} Now, We need, locate the CBL commands, and my program don't want work.

>} The code is here : (A piece)
>
>} '| LOCATE ANYCASE 8-* / CALL /', /* Look for CALL Commands */
>
>This LOCATE is looking for blankCALL starting in col 8.  Suppose the
>CALL is in col 8, no match.
>
>--
>Rich Greenberg  Sarasota, FL, USA richgr atsign panix.com  + 1 941 378 

2097
>Eastern time.  N6LRT  I speak for myself & my dogs only.    VM'er si
nce 
CP-67
>Canines: Val, Red, Shasta, Zero & Casey (At the bridge)     
   
Owner:Chinook-L
>Canines: Red & Cinnar (Siberians)  Retired at the beach  Asst 
Owner:Sibernet-L
>========================
=========================
========================

COBOL has two types of "CBL" statements.  "CBL" contains COBOL Compiler 

Options and must start in column 8 or later and must end before column 72
 
and must appear in the program before the ID Division and before any 
comment records, (basically "CBL" must be first).  There can be 
multiple "CBL" statements if needed.  "CBL" can also be entered 
as "PROCESS" so you you would have have to look for either one of them. 
 
Either a multi-stream pipeline would have to be contructed or you 
could "cheat" :-) by using an ALL Pipe stage.  ALL unfortunately does not
 
support the ANYCASE parm or column ranges, but you could replace the 
LOCATE ANYCASE stage with:
'| ZONE 8-* CASEI ALL / CBL /!/ PROCESS /'

The other COBOL "CBL" statement is "*CBL" and is used to control the 
listing generated by the COBOL compiler.  "*CBL" must start in column 7 o
r 
later and can also be coded as "*CONTROL".  If that is what you are 
looking for, then you would need to replace both the 
'| NLOCATE 8 /*/',              
'| LOCATE ANYCASE 8-* / CALL /',
with
'| ZONE 8-* CASEI ALL /*CBL /!/*CONTROL /'

-- 
Dale R. Smith

Reply via email to