How do we identify the compiler options specified for any Cobol program installed in production.

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Rudhra
Registered Member
Posts: 11
Joined: Wed Dec 18, 2013 10:17 am

How do we identify the compiler options specified for any Cobol program installed in production.

Post by Rudhra »

How do we identify the compiler options specified for any Cobol program installed in production. Is there a JCL using which we can identify these options?
Thanks,
Rudhra
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: How do we identify the compiler options specified for any Cobol program installed in production.

Post by nicc »

Why not look at the output of the compile? Or ask your change management support?
Regards
Nic
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1891
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: How do we identify the compiler options specified for any Cobol program installed in production.

Post by Robert Sample »

Generally speaking, there is no way to identify the options used to compile a particular load module. Some of the options, such as OPT, impact the code generated in the load module but the options are not stored within the load module. As stated elsewhere, look at the compile output or talk to your site's support group. If you don't have compile output available, you will probably find that it is not possible to recreate the compiler options.
User avatar
runningppl
New Member
Posts: 1
Joined: Sat Dec 16, 2017 12:45 am

Re: How do we identify the compiler options specified for any Cobol program installed in production.

Post by runningppl »

It depends. If you are using IBM Enterprise COBOL 5 on z/OS and above, the load module has a section named 'Compiler Options and Program Information Section' near the end. The way to calculate the offset to the section from the entry point is described in the IBM "Language Environment Vendor Interfaces" .
(https://www.ibm.com/support/knowledgece ... 00/toc.htm)

The following is the example of the section
Compiler Options and Program Information Section
1PP 5655-EC6 IBM Enterprise COBOL for z/OS 6.1.0 P171205 X1 Date 12/15/2017 Time 14:12:31 Page 26
0 000F84 0034 =X'0034' Size of Compiler Options and Prog Info Section
000F86 (+00) 0474 =X'0474' UNSIGNED BINARY CODE PAGE CCSID VALUE
000F88 (+02) 07 =X'07' ARCHITECTURE LEVEL
000F89 (+03) 00 =X'00' OPTIMIZATION LEVEL
000F8A (+04) 1406 =X'1406' INFO. BYTES 28-29
000F8C (+06) 0000 =X'0000' INFO. BYTES 30-31
000F8E (+08) A0C8754C2000 =X'A0C8754C2000' INFO. BYTES 1-6
000F94 (+14) 001050884109 =X'001050884109' INFO. BYTES 7-12
000F9A (+20) 002000400000 =X'002000400000' INFO. BYTES 13-18
000FA0 (+26) 0000008009 =X'0000008009' INFO. BYTES 19-23
000FA5 (+31) 00 =X'00' COBOL SIGNATURE LEVEL
000FA6 (+32) 00000016 =X'00000016' # DATA DIVISION STATEMENTS
000FAA (+36) 00000027 =X'00000027' # PROCEDURE DIVISION STATEMENTS
000FAE (+40) 00008000 =X'00008000' INFO. BYTES 24-27
000FB2 (+44) D7F1F7F1F2F0F540 =C'P171205 ' BUILD LEVEL INFO
Compiler Options and Program Information Section End
Each of the bytes can be decoded and described in "Enterprise COBOL for z/OS Programming Guide".
You will get more replies if you specify the COBOL you are using.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”