×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

UNIX 198 "Load Error" with dynamically called MF COBOL subprogram

UNIX 198 "Load Error" with dynamically called MF COBOL subprogram

UNIX 198 "Load Error" with dynamically called MF COBOL subprogram

(OP)
When running our UNIX job scripts we randomly get the following 198 error below. When we restart the job it works fine. The Driver and subprogram are both coded in MF COBOL and create a .gnt executable. I haven't been able to recreate the problem in test, so I'm wondering if it has something to do with Cron or possibly a memory error or memory leak. I don't see anything obvious in the COBOL subprogram DATECONV and not sure why is looking for a .so file. Any help would be greatly appreciated!

   Load error : file 'DATECONV.so'
   error code: 198, pc=0, call=1, seg=0
   198 Load failure (fatal: _ex_unwind: can't find symbol)

RE: UNIX 198 "Load Error" with dynamically called MF COBOL subprogram

198 is strictly a Micro Focus COBOL error code.  In the past, I have never been able to pinpoint a specific cause.  I think memory is being corrupted, but I'm not sure.

Of course, if the called program does not exist in the load path, you will always get this error, but you say it is random and cannot be reliably repeated.

RE: UNIX 198 "Load Error" with dynamically called MF COBOL subprogram

(OP)
Would changing the Call of DATECONV from a Dynamic to a Static call fix the problem?  This program is very stable and rarely changes.

RE: UNIX 198 "Load Error" with dynamically called MF COBOL subprogram

That is definately a possiblity.

RE: UNIX 198 "Load Error" with dynamically called MF COBOL subprogram

(OP)
I changed the call of the subprogram from dynamic to static by changing the call from

01  DATECONV                   PIC X(08) VALUE 'DATECONV'.
CALL DATECONV USING......

to

CALL 'DATECONV' USING......

I'm still getting the same load error as before.  Anyone have any ideas on what may be the problem or something I should check?

RE: UNIX 198 "Load Error" with dynamically called MF COBOL subprogram

Is the application still in the correct directory?
Are the environment variables COB* set up properly?

RE: UNIX 198 "Load Error" with dynamically called MF COBOL subprogram

You have to set up a hard link during the link step.  I used to know how to do this, but have fogotten.

RE: UNIX 198 "Load Error" with dynamically called MF COBOL subprogram

We have lots of MF cobol programs running under unix (solaris or aix) here's a snippet of how do calls to other programs or scripts:

WS:

01  CALLS-SCRIPT.
    02  CALLSWS-CMD-STRING.
        03  CALLSWS-SYS-COMMAND PIC X(100) VALUE SPACES.
        03  CALLSWS-NULL-CHAR   PIC X(001) VALUE x"00".

PROCEDURE:

INITIALIZE CALLSWS-CMD-STRING.

STRING "CALL_mail.ksh"
      DELIMITED BY SIZE
         INTO CALLSWS-CMD-STRING.

CALL "SYSTEM" USING CALLSWS-CMD-STRING.


NOTE: In unix you have to have a NULL character at the end of your command string.

Hope this helps.

RE: UNIX 198 "Load Error" with dynamically called MF COBOL subprogram

(OP)
Thanks jmanj,

So for my example, my call was originally:

01  DATECONV                   PIC X(08) VALUE 'DATECONV'.
CALL DATECONV USING  WS-DATE-FIELDS.

You are saying I should change it to:
 
INITIALIZE CALLSWS-CMD-STRING.
STRING "CALL_mail.ksh"
      DELIMITED BY SIZE
         INTO CALLSWS-CMD-STRING.
MOVE LOW-VALUES TO CALLSWS-NULL-CHAR.
CALL "DATECONV" USING CALLSW-CMD-STRING,
                      WS-DATE-FIELDS.

RE: UNIX 198 "Load Error" with dynamically called MF COBOL subprogram

(OP)
jmanj

Can you reply back and let me know if this is the change you are suggesting?

Thanks

RE: UNIX 198 "Load Error" with dynamically called MF COBOL subprogram

There is more to unix than just calling programs or scripts.
we use 'SYSTEM' to indicate that all scripts like perl or ksh, awk etc are treated as system commands. You will also need to provide the full path of you command executables (bin directories) in your environment variables.

If your DATECONV is a cobol program then you need to create a linkage then you can statistically or dynamically call it:
   CALL 'DATECONV' using parms

Again you will need to create COBPATH variable where all the cobol execs are located.

In our case we have a C program that invoke other cobol programs. We use INVOKE instead of a call. The only difference is that we can test for return codes from the invoked programs. The micro focus manual should provide you an instruction on how to dynamically link sub programs.

It's been a while so I don't remember how I did it.

RE: UNIX 198 "Load Error" with dynamically called MF COBOL subprogram

(OP)
So it sounds like I don't need the CALL "SYSTEM".  I'm doing what you have stated above.  The COBPATH is pointing to the correct directory of my subprogram DATECONV.gnt.  The Driver programs and subprograms are all MF COBOL.  I've linked it dynamically and statically and either way I still go the Load Error periodically.  I'm not sure if there is any difference between
   CALL 'DATECONV' using parms
and
   CALL "DATECONV" using parms
Both of these should link the DATECONV program statically to the Driver program.

If your DATECONV is a cobol program then you need to create a linkage then you can statistically or dynamically call it:
   CALL 'DATECONV' using parms

RE: UNIX 198 "Load Error" with dynamically called MF COBOL subprogram

There are may cobol paths that needs to be defined in your environment (sorry but I forgot the names). You may also check the permissions to the locations and executables. There are many reason for code 198. You may have to recompile DATECONV (could be corrupted) or on rare occasion you may have not enough memory to run your program. Another thing to look at are misspelled path names.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close