Highlighted
Absent Member.
Absent Member.
780 views

Reading Cobol program using another program.

Jump to solution

Good Afternoon All,

 

Can you please help me here i have been given a task to read a Cobol Program which contains several CALLING statements. these Calling statements include statements that call other programs since its a mainmenu it also calls other MENUs. now i am required to write a program that READS this program and print out all program CALLS for other programs and print them in an INDEXED file starting with MAINMENU (which is the program containing other programs).

 

now i have converted MAINMENU.cbl as text input file, please help me i cant get the program.

 

Best Regards

Zux

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Reading Cobol program using another program.

Jump to solution
You have stated that you use ACUCOBOL-GT but you have posted this question to the Visual COBOL forum. Visual COBOL is a completely different COBOL compiler product than the ACUCOBOL-GT product. I would suggest that you repost this question to the ACUCOBOL forum on this community site and perhaps they can steer you in the right direction.

As I stated previously, Micro Focus sells products that will do this task for you. You might want to contact your Micro Focus Account Manager and ask about the COBOL Analyzer product. Then you don't have to reinvent the wheel.

Thanks.

View solution in original post

0 Likes
3 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Reading Cobol program using another program.

Jump to solution
I am a bit unclear about what your actual question is here. It sounds like you are trying to write a program that will read through your source files and parse them looking for CALL statements and then writing the program names of all programs that are being called into an indexed file.

You should be able to open and read standard COBOL source files as line sequential files in your program but the parsing could get tricky as the call statements can span multiple source lines, could be on comment lines, could have multiple statements per line, etc. etc.

Can I ask what the ultimate goal of this task is?

If you are trying to get the call hierarchy of your application, there are several tools available to do this. If you are using Visual COBOL for Visual Studio you can right-click on the program-id and select View Call Hierarchy and it will provide you with a report.

Micro Focus also sells a product called COBOL Analyzer which will provide you with a detailed look at the CALL structure of your entire application.

If you provide details on what it is you are trying to accomplish, I can make a better recommendation.

Thanks
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Reading Cobol program using another program.

Jump to solution
Thank you Chris,

Your first paragraph is true i am tasked to create program that will read a source code looking for CALL statements n writing program names in an indexed file. Here the company is developing using ACUCOBOL-GT and i am a Novice in COBOL.

The goal of this program is to actually see the programs that are no longer used in the system so that they can be removed to optimize memory. It further states that it should not print programs that are commented, only those that can be read at run-time.

I am looking for help in creating this program since i have never developed using COBOL however believe developing is different in languages but having the same syntax.

Hope i provided enough information,

Regards
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Reading Cobol program using another program.

Jump to solution
You have stated that you use ACUCOBOL-GT but you have posted this question to the Visual COBOL forum. Visual COBOL is a completely different COBOL compiler product than the ACUCOBOL-GT product. I would suggest that you repost this question to the ACUCOBOL forum on this community site and perhaps they can steer you in the right direction.

As I stated previously, Micro Focus sells products that will do this task for you. You might want to contact your Micro Focus Account Manager and ask about the COBOL Analyzer product. Then you don't have to reinvent the wheel.

Thanks.

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.