Page 1 of 1

COBOL program to extract copbook & DCLGEN

PostPosted: Wed Mar 30, 2011 6:38 pm
by srikkanth.lovable
Friends,

Could you please help me in writing a code snippet of the below requirement:

The COBOL program need to read an Input file ( Input file contains a COBOL program) and output file should write the following

Program_id Copybook/ DCLGEN


For Example :
INPUT FILE CONTAINS :

IDENTIFICATION DIVISION.
PROGRAM ID. SAMPLE01.
---------------------
--------------
COPY <XYZ123>
COPY <ABC123>
--------
----


EXEC SQL
INCLUDE <PQRST>
END-SQL

---------
-------


OUTPUT SHOULD BE

OUTPUT

PROGRAM-ID COPYBOOK
SAMPLE01 XYZ123
SAMPLE01 ABC123
SAMPLE01 PQRST

Please advice.

Re: COBOL program to extract copbook & DCLGEN

PostPosted: Wed Mar 30, 2011 6:43 pm
by srikkanth.lovable
Friend, could you please advice if you know the logic

Re: COBOL program to extract copbook & DCLGEN

PostPosted: Wed Mar 30, 2011 6:46 pm
by BillyBoyo
Well, I suppose you've moved it to the correct forum now. Have you done anything else?

Do you have a specification for your pre-processor statements? If not, make one yourself and keep it as simple as you can.

For instance, if COPY can only start in column 1, that makes it easier. Just define PIC X(5) and test for equal to "COPY ". Similar for your INCLUDE.

Of course, this will be nowhere near a general-pupose approach that will be any good to you in the future, but if you're aiming for that you have to do some work yourself as well.

Re: COBOL program to extract copbook & DCLGEN

PostPosted: Wed Mar 30, 2011 11:48 pm
by srikkanth.lovable
Thanks for the reply Boyo , The problem is the copybook can start from any position between 8 and 12 and the copybook could be of between 3 to 8 bytes.
The same case with the include.This is happening due to developers not following coding standards besides iam trying to implement using unstring function.

Re: COBOL program to extract copbook & DCLGEN

PostPosted: Thu Mar 31, 2011 12:54 am
by enrico-sorichetti
do You have a doctor' s prescription to do it in COBOL ???
check the usage of the different flavors of the ISPF member parts list application
( it produces if You want an unformatted file that can be formatted afterwards in any way You want )
as already suggested in Your other topic on the same subject

or even better evaluate the use of the HLASM toolkit cross reference tool
http://publibz.boulder.ibm.com/cgi-bin/ ... 0803114456

Re: COBOL program to extract copbook & DCLGEN

PostPosted: Thu Mar 31, 2011 2:46 am
by srikkanth.lovable
Thank you .. iam a beginner in this.ISPF member parts list application, it would be great if you can expand on member parts..Any how iam checking with the same.

Re: COBOL program to extract copbook & DCLGEN

PostPosted: Thu Mar 31, 2011 3:06 am
by BillyBoyo
Since you have another thread for this task already in the Cobol forum, perhaps this one can head off to TSO/ISPF?

Re: COBOL program to extract copbook & DCLGEN

PostPosted: Tue Apr 12, 2011 3:22 pm
by franky226
read the record, then using tht string function, if find copy or include, move it into output.

Re: COBOL program to extract copbook & DCLGEN

PostPosted: Tue Apr 12, 2011 3:44 pm
by prino
What's wrong with SuperC and a bit of post-processing?