mysiar
mysiar

Reputation: 484

ZOS/Unix cob2 compiling and executing

I'm starting with Cobol on ZOS/Unix.

My  environment is terminal via SSH to ZOS machine.

I have Cobol program hello.cbl with basic code to display message.

       IDENTIFICATION DIVISION.
       PROGRAM-ID. "HELLOWORLD".
       AUTHOR. PIOTR SYNOWIEC.
       ENVIRONMENT DIVISION.


       DATA DIVISION.
       
       PROCEDURE DIVISION.
       MAIN-PROCEDURE.
           DISPLAY "**************************************************"
           DISPLAY " *** Hello World"
           
           STOP RUN.
       END PROGRAM HELLOWORLD.

Program compiles easily with GnuCobol & IBM Cobol compiler on Linux and I can easily execute compiled program.

I tried the same on ZOS/Unix using flag "RENT" as per description here https://www.ibm.com/docs/en/zos/2.1.0?topic=services-running-cobol-programs-under-zos-unix

cob2 -v hello.cbl -o hello.exe

Compiler messages

compiler: ATTCRCTL PARM=RENT,TERM /u/ibmuser/TIPS/tests/basic/hello.cbl
linker: /bin/c89 -o hello.exe -e // hello.o

Running program

./hello.exe

Message

Killed

Tried with -q64

cob2 -v -q64 hello.cbl -o hello.exe

Compiler messages:

compiler: ATTCRCTL PARM=RENT,TERM,LP(64) /u/ibmuser/TIPS/tests/basic/hello.cbl
linker: /bin/c89 -o hello.exe -Wl,LP64 -e // hello.o
 IEW2480W A711 EXTERNAL SYMBOL CEELLIST OF TYPE LD WAS ALREADY DEFINED AS A
          SYMBOL OF TYPE LD IN SECTION CELQLLST.
 IEW2482W A712 THE ORIGINAL DEFINITION WAS IN A MODULE IDENTIFIED BY DDNAME
          SYSLIB.  THE DUPLICATE DEFINITION IS IN SECTION CEEBLLST  IN A
          MODULE IDENTIFIED BY DDNAME SYSLIB.
FSUM3065 The LINKEDIT step ended with return code 4.

running result is the same: Killed

Could anybody help me to sort that out ?

Upvotes: 2

Views: 247

Answers (1)

mysiar
mysiar

Reputation: 484

this solved the problem STEPLIB=IGY630.SIGYCOMP

Upvotes: 1

Related Questions