Highlighted
AJL Absent Member.
Absent Member.
517 views

JVM COBOL - Error 119 Name not unique

Jump to solution

Hello,

I am calling a cobol program, from a Java servlet.

I can successfully run the cobol program, but if I display a JSP, and then try to invoke the program again, I get the following exception:

com.microfocus.cobol.program.COBOLRuntimeException: 119     Name is not unique 

This is how I am invoking the program…

private Boolean STAGE_1 (StateLinkage sl, IRunUnit runUnit, HttpServletRequest req, HttpServletResponse res)
{
boolean successFlag = false;

AMSC535A pgm = new AMSC535A();
Amsc535aParms AMSC535Aparms = new Amsc535aParms();
runUnit.Add(pgm);

int GCSrc = pgm.AMSC535A(AMSC535Aparms);


if ( GCSrc < GCS_WARNING )
  { successFlag = true; }

return successFlag;
}

 

 

 

Could someone advise me on how to fix this please.

 

Tags (1)
0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

RE: JVM COBOL - Error 119 Name not unique

Jump to solution
If you use the GetInstance method, this allows you get get/or create a program, this avoids adding the program twice.

eg:
Amsc535aParms AMSC535Aparms =(Amsc535aParms)runUnit.GetInstance(Amsc535aParms.class);

and remove the .Add(..)
0 Likes
2 Replies
Micro Focus Expert
Micro Focus Expert

RE: JVM COBOL - Error 119 Name not unique

Jump to solution
If you use the GetInstance method, this allows you get get/or create a program, this avoids adding the program twice.

eg:
Amsc535aParms AMSC535Aparms =(Amsc535aParms)runUnit.GetInstance(Amsc535aParms.class);

and remove the .Add(..)
0 Likes
AJL Absent Member.
Absent Member.

RE: JVM COBOL - Error 119 Name not unique

Jump to solution
Thank you spgennard,
that seems to have done the trick.

I have ended up doing the following...
AMSC524A pgm = (AMSC524A)runUnit.GetInstance(AMSC524A.class);
if ( pgm == null)
{ pgm = (AMSC524A)runUnit.GetInstance(AMSC524A.class,true);}
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.