Skip to main content
Wulf Gollin
New Participant
Jan 3, 2022 9:51 PM UTC

Ubuntu 7.0 Load error : file '_EXTNAME'

i am getting a runtime error "Load error : file '_EXTNAME'". I am using external Variables.

Ubuntu cobol server 7.0 (Update 4). On V6.0 it works fine.

Is there a path or a file missing?

    8 replies

    Blair McDonald
    Moderator
    Jan 5, 2022 4:33 AM UTC

    i am getting a runtime error "Load error : file '_EXTNAME'". I am using external Variables.

    Ubuntu cobol server 7.0 (Update 4). On V6.0 it works fine.

    Is there a path or a file missing?

    Hello @wgherm,

     

    Welcome to the Micro Focus Community Site. Below, I have a few questions to help learn more about your issue.

     

    • Micro Focus provides a script cobsetenv to set the minimum environment for running the product. You might try running the program again after first sourcing this script to make sure the minimum environment has been set. The following example has a space after the period character:

    . $COBDIR/bin/cobsetenv

    myexecutable

     

    • You've mentioned using COBOL Server 7.0 Patch Update 4. What version of Visual COBOL Development Hub was used to compile the failing COBOL program?

     

    • If available, does the same error occur on a server running Visual COBOL Development Hub 7.0 Patch Update 4?

     

    • It may help to see more context with the error message. Can you post the full error message with a few lines above it, for context?

     

    • What type of compiled module is your COBOL program built to? Is it an .int, or .gnt, or .so, or native executable file? If this is a .so or native executable, can you provide the output of the "ldd" command run against the compiled module? For example:

    ldd myexecutable

     

    Blair

    Wulf Gollin
    New Participant
    Jan 5, 2022 9:17 PM UTC

    Hello @wgherm,

     

    Welcome to the Micro Focus Community Site. Below, I have a few questions to help learn more about your issue.

     

    • Micro Focus provides a script cobsetenv to set the minimum environment for running the product. You might try running the program again after first sourcing this script to make sure the minimum environment has been set. The following example has a space after the period character:

    . $COBDIR/bin/cobsetenv

    myexecutable

     

    • You've mentioned using COBOL Server 7.0 Patch Update 4. What version of Visual COBOL Development Hub was used to compile the failing COBOL program?

     

    • If available, does the same error occur on a server running Visual COBOL Development Hub 7.0 Patch Update 4?

     

    • It may help to see more context with the error message. Can you post the full error message with a few lines above it, for context?

     

    • What type of compiled module is your COBOL program built to? Is it an .int, or .gnt, or .so, or native executable file? If this is a .so or native executable, can you provide the output of the "ldd" command run against the compiled module? For example:

    ldd myexecutable

     

    Blair

    Load error : file '_EXTNAME'
    error code: 173, pc=6B5, call=1, seg=0
    173 Called program file not found in drive/directory


    cobol@zzz4:/usr/zup/pgm/03/an$ ldd z03an001.int
    not a dynamic executable

    INT is built with a windows Compiler, patchlevel 0 or 1. Dev Hub on Ubuntu is not installed (but on V6)

    Blair McDonald
    Moderator
    Jan 6, 2022 4:00 AM UTC

    Load error : file '_EXTNAME'
    error code: 173, pc=6B5, call=1, seg=0
    173 Called program file not found in drive/directory


    cobol@zzz4:/usr/zup/pgm/03/an$ ldd z03an001.int
    not a dynamic executable

    INT is built with a windows Compiler, patchlevel 0 or 1. Dev Hub on Ubuntu is not installed (but on V6)

    Thanks for your response.

     

    Unfortunately, I have not been able to reproduce the error you described. I've tested with a pair of small programs which include both external files and external variables. The programs were compiled to .int on Windows with Visual COBOL 6.0, and then run on Ubuntu using COBOL Server 7.0 Patch Update 4. I'll provide the source for these programs below. Please try them in your environment and let me know if they run without error.

     

    mainprog.cbl

     

           identification division.

           program-id. mainprog.

     

               select test-file assign to "testfile.txt"

                                organization is line sequential

                                file status is file-status.

     

           data division.

           fd test-file external.

           01 test-record pic x(20).

           working-storage section.

           01 file-status pic x(2) is external.

           01 ext-item    pic x(10) is external.

           procedure division.

     

               move "mainprog" to ext-item

               open output test-file

               if file-status = "00"

                   display "open OK"

               else

                   display "open failed = " file-status

               end-if

               move all "1" to test-record

               write test-record

               if file-status = "00"

                   display "write OK"

               else

                   display "write failed = " file-status

               end-if

               call "subprog"

     

               display "return from subprog"

               display "ext-item = " ext-item

               read test-file

               if file-status = "00"

                   display "read OK - rec = " test-record

               else

                   display "read failed = " file-status

               end-if

               close test-file     

               goback.

               

           end program mainprog.

     

    Subprog.cbl

     

           identification division.

           program-id. subprog.

     

               select test-file assign to "testfile.txt"

                                organization is line sequential

                                file status is file-status.

     

           data division.

           fd test-file external.

           01 test-record pic x(20).

           working-storage section.

           01 file-status pic x(2) is external.

           01 ext-item    pic x(10) is external.

           procedure division.

     

               display "in subprog"

               display "ext-item = " ext-item

               move "subprog" to ext-item

               

               move all "2" to test-record

               write test-record

               if file-status = "00"

                   display "write OK"

               else

                   display "write failed = " file-status

               end-if

               close test-file

               open input test-file

               if file-status = "00"

                   display "open OK"

               else

                   display "open failed = " file-status

               end-if

               goback.

     

    If these programs do not reproduce the problem, feel free to modify them so that they reproduce the issue you've described.

    Wulf Gollin
    New Participant
    Jan 7, 2022 6:40 PM UTC

    i am getting a runtime error "Load error : file '_EXTNAME'". I am using external Variables.

    Ubuntu cobol server 7.0 (Update 4). On V6.0 it works fine.

    Is there a path or a file missing?

    I've found it. My program uses "_EXTNAME" to read value from environment variable

    556 CALL "_EXTNAME" USING USRNAME2-FILE-SET USRNAME-FILE-LOC
    557 CANCEL "_EXTNAME"

    Wulf Gollin
    New Participant
    Jan 7, 2022 7:10 PM UTC

    I've found it. My program uses "_EXTNAME" to read value from environment variable

    556 CALL "_EXTNAME" USING USRNAME2-FILE-SET USRNAME-FILE-LOC
    557 CANCEL "_EXTNAME"

    maybe, this is the better way:

    display "USERNAME" upon environment-name 
    accept val from environment-value
    
    Chris Glazier
    Moderator
    Jan 7, 2022 7:30 PM UTC

    I've found it. My program uses "_EXTNAME" to read value from environment variable

    556 CALL "_EXTNAME" USING USRNAME2-FILE-SET USRNAME-FILE-LOC
    557 CANCEL "_EXTNAME"

    Can you please clarify if the problem is now solved or it is still occurring even if program _EXTNAME exists?

    Wulf Gollin
    New Participant
    Jan 7, 2022 8:16 PM UTC

    i am getting a runtime error "Load error : file '_EXTNAME'". I am using external Variables.

    Ubuntu cobol server 7.0 (Update 4). On V6.0 it works fine.

    Is there a path or a file missing?

    code is changed, problem is solved. 

    Gael Wilson
    Rocketeer
    Jan 11, 2022 2:59 PM UTC

    code is changed, problem is solved. 

    Just fyi,

    _EXTNAME is not a program, it is an entry point in the COBOL run-time system on Windows that exists purely for compatibility with old products, probably predating the syntax for handling environment variables that the code has been changed to use. I don't think that it was ever in Unix/Linux products and is no longer documented so the change that you have made is correct.