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.
Previous topicNext topic

Topic Author
Rudhra
New Member
Posts: 9
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 » Fri Dec 15, 2017 3:48 pm

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: 597
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 » Fri Dec 15, 2017 5:58 pm

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: 1379
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
Zodiac: Virgo

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

Post by Robert Sample » Fri Dec 15, 2017 6:31 pm

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 » Sat Dec 16, 2017 1:01 am

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.



Previous topicNext topic

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