COBOL program to extract copbook & DCLGEN



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

COBOL program to extract copbook & DCLGEN

Postby srikkanth.lovable » Wed Mar 30, 2011 6:38 pm

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.
srikkanth.lovable
 
Posts: 12
Joined: Wed Mar 16, 2011 12:34 pm
Has thanked: 0 time
Been thanked: 0 time

Re: COBOL program to extract copbook & DCLGEN

 

Re: COBOL program to extract copbook & DCLGEN

Postby srikkanth.lovable » Wed Mar 30, 2011 6:43 pm

Friend, could you please advice if you know the logic
srikkanth.lovable
 
Posts: 12
Joined: Wed Mar 16, 2011 12:34 pm
Has thanked: 0 time
Been thanked: 0 time

Re: COBOL program to extract copbook & DCLGEN

Postby BillyBoyo » Wed Mar 30, 2011 6:46 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: COBOL program to extract copbook & DCLGEN

Postby srikkanth.lovable » Wed Mar 30, 2011 11:48 pm

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.
srikkanth.lovable
 
Posts: 12
Joined: Wed Mar 16, 2011 12:34 pm
Has thanked: 0 time
Been thanked: 0 time

Re: COBOL program to extract copbook & DCLGEN

Postby enrico-sorichetti » Thu Mar 31, 2011 12:54 am

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: COBOL program to extract copbook & DCLGEN

Postby srikkanth.lovable » Thu Mar 31, 2011 2:46 am

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.
srikkanth.lovable
 
Posts: 12
Joined: Wed Mar 16, 2011 12:34 pm
Has thanked: 0 time
Been thanked: 0 time

Re: COBOL program to extract copbook & DCLGEN

Postby BillyBoyo » Thu Mar 31, 2011 3:06 am

Since you have another thread for this task already in the Cobol forum, perhaps this one can head off to TSO/ISPF?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: COBOL program to extract copbook & DCLGEN

Postby franky226 » Tue Apr 12, 2011 3:22 pm

read the record, then using tht string function, if find copy or include, move it into output.
franky226
 
Posts: 2
Joined: Tue Apr 12, 2011 3:03 pm
Has thanked: 0 time
Been thanked: 0 time

Re: COBOL program to extract copbook & DCLGEN

Postby prino » Tue Apr 12, 2011 3:44 pm

What's wrong with SuperC and a bit of post-processing?
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 536
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 21 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post