What does that mean by Cobol error code: 243? - oop

I got the error when running the Cobol program in Micro Focus Cobol Eclipse. Don't know why this happened. Please help me as I have to submit this as a part of my big homework tommorrow.
Another question, if possible, please help me with the variable, I am putting it in local-storage section. for example, in Java, I want to set it as global for every method to get access?
The control file :
Identification Division.
Program-Id. Client.
Environment Division.
Configuration Section.
Repository.
Class Student.
Data Division.
Working-Storage Section.
01 H object reference Student.
Procedure Division.
display "goodbye goodbye".
Invoke Student "new" returning H.
Invoke H "sayHello".
Invoke H "GetAverage" .
Invoke H "Grading".
Exit Program.
End Program Client.
Here is the class file:
class-id. Student data is protected
* inherits from base with data
inherits Base.
object section.
class-control.
Student is class "student"
base is class "base"
.
working-storage section.
class-object.
object-storage section.
Method-Id. sayHello.
Procedure Division.
Display "Hello World!".
* Display "I'm hello".
End Method sayHello.
*Method1
method-id. "GetAverage".
local-storage section.
linkage section.
01 English pic 99 value 9.
01 Math pic 99 value 5.
01 AverMark pic 99 value 3.
procedure division using by reference English,
by reference Math.
* returning AverMark.
COMPUTE AverMark = (English+Math)/2
Display "Average mark is ", AverMark.
Accept English.
exit method.
end method "GetAverage".
*Method2
method-id. "Grading"
local-storage section.
linkage section.
01 AverMark pic 9.
01 Grade pic X.
procedure division using by reference AverMark.
* returning Grade.
IF AverMark < 5
MOVE "FAIL" TO Grade
ELSE
MOVE "PASS" TO Grade.
exit method.
end method "Grading".
end class-object.
end class Student.
The result is:
goodbye goodbye
Execution error : file 'Client'
error code: 243, pc=0, call=1, seg=0
243 error message text not found

According to documentation on the Micro Focus site an error 243 is explained as follows ..
"COBRT243 Class could not be loaded (Fatal)
An attempt to load an object class has failed because the class does not contain a valid Class-Control section, or because the class is not defined correctly."
Check that you've defined Student properly.

Related

How to get string length and subtring an User Defined Variables in Jmeter

I define an User Defined Variables with name:
message_title: "Test searching by title message"
Then I need to run a test case that input is a child string of above variables such as: "search" or "title".
I used an User Parameter and define 2 variables with name:
len : ${__strLen(${message_title})}
middle_search: ${__substring(${message_title}, 5, ${__intSum(${len},-5)})}
But when I run test case it throw error:
51 ERROR - jmeter.threads.JMeterThread: Test failed! java.lang.NumberFormatException: For input string: "${__strLen(${message_title})}....
How can I get length and a child string of User Defined Variables?
Thanks,
For length this works for me, I store result in len variable:
${__strLen(${message_title},len)}
Then:
${__substring(${message_title},5,${__intSum(${len},-5)},)}
As per User Defined Variables documentation:
UDVs are processed in the order they appear in the Plan, from top to bottom.
So you can basically go for 2 User Defined Variables instances
Add User Defined Variables #1 to your Test Plan and define the following variables there:
message_title = Test searching by title message
len - ${__strLen(message_title,)}
Add User Defined Variables #2 to your Test Plan and define the following variable there:
middle_search= ${__substring(${message_title},5,${__intSum(${len},-5)},)}
That's it, you should be able to access the defined variables in Thread Group(s)
Just in case check out Using User Defined Variables article to learn more about User Defined Variables concept.

Override translation from original module

How can I override translation of default_code field?
in inherited Product Template and Product Product, I added fields
default_code = fields.Char(
string='Articul',
related='product_variant_ids.default_code')
and
default_code = fields.Char(
'Articul', select=True)
string changes in the English version but if I change to my language then I get an original translation.
So i tried to copy a part from original modules translation and add it to my po file like this.
#. module: product
#: model:ir.model.fields,field_description:product.field_product_product_default_code
#: model:ir.model.fields,field_description:product.field_product_template_default_code
msgid "Articul"
msgstr "Articulas"
it works but when I want to update my file with Poedit I getting an error
2018 m. liepos 30 d. 15:43:37: /tmp/poedituUNIro/1input.po:1023: duplicate message definition...
2018 m. liepos 30 d. 15:43:37: /tmp/poedituUNIro/1input.po:169: ...this is the location of the first definition
2018 m. liepos 30 d. 15:43:37: msgmerge: found 1 fatal error
2018 m. liepos 30 d. 15:43:37: Entries in the catalog are probably incorrect.
2018 m. liepos 30 d. 15:43:37: Updating the catalog failed. Click on 'Details >>' for details.
No need to redeclare the field string!
Export the translation file from the add-ons you want to override.
Translate it using POEeit or similar.
Drop the translation file inside a i18n_extra folder in the addon. E.g.: addon/i18n_extra/fr.pot
Update the addon.
With that system, a submodule is able to override translations from parent modules.

NAT3176 Error in call to Adabas subroutine or in inverted list

I am having trouble figuring out how to fix this error in Natural Adabas. I am just starting out with Natural on a very old version and the problem I keep running into trying to run most of the existing programs written by previous developers is that I keep getting this error.
NAT3176 Error in call to Adabas subroutine or in inverted list.
So I have attempted a very basic program of my own with the same result (see below). Does anybody know how to resolve this problem or what steps can be taken to debug?
My first thought is that the STUD list does not exist even though there is a DDM for it. Is there a way I could verify that it exists?
My test program is as follows:
0010 DEFINE DATA
0020 LOCAL
0030 1 STUD-VIEW VIEW OF STUD
0040 2 STUDNO
0050 END-DEFINE
0060 READ STUD-VIEW BY STUDNO
0070 DISPLAY STUDNO
0080 END-READ
0090 END
NAT3176: Inconsistency detected in an inverted list.
That's what the docs say, so very likely the Index ("inverted list") is corrupt.
You'll certainly need your Admin to fix that.
Try omitting the BY STUDNO from the READ Statement.
It will then perform a READ PHYSICAL ("Full Table Scan" in a relational DB) which accesses the data without using the index.
That would look something like this:
DEFINE DATA
LOCAL 1 STUD-VIEW VIEW OF STUD
2 STUDNO
END-DEFINE
*
READ STUD-VIEW
DISPLAY STUDNO
END-READ
END

Sap Code Inspector - Generating a table of all PCodes linked to the classes

I have problems to read the error codes and corresponding messages of SCI message classes.
Is there an way to easy access those?
I'm using "Praxishandbuch SAP Code Inspector" as a reference, but in that regard it is of no help.
I looked in Se11 but the information to the messages isn't helpful.
Has someone an approch to build such a table?
You can try this, perhaps it will work for you. I use the code below to get the access to all the errors found by Code Inspector for particular user(s):
data: ref_inspec_a type ref to cl_ci_inspection.
ref_inspec_a = cl_ci_inspection=>get_ref(
p_user = pa_iuser
p_name = pa_inam
p_vers = pa_ivers ).
data: ls_resp type scir_resp,
lt_resp type scit_resp.
clear: ls_resp, lt_resp.
ls_resp-sign = 'I'.
ls_resp-option = 'EQ'.
ls_resp-low = pa_fuser.
insert ls_resp into table lt_resp.
call method ref_inspec_a->get_results
exporting
p_responsibl = lt_resp
exceptions
insp_not_yet_executed = 1
overflow = 2
others = 3.
Playing around with LT_RESP you can get results for more users at the same time.
After you execute the code above, you can check the attributes SCIRESTPS and SCIRESTHD of the object REF_INSPEC_A. These are the large tables, which contain the result data of the SCI check. You can either work with them on your own, or you can simply pass the object REF_INSPEC_A into the function module SCI_SHOW_RESULTS to get regular SCI user interface.
I found out that you can get all the changeable messages (found in SCI GoTo/Management Of/ Message Priorities) can be read from the scimessages attribute of the test classes.
With this help you can get about 60% of all errors.

how to create Delphi 4 structure to map column names in XLS to column names in SQL

I have an EXCEL sheet.it has various form-fields that are named as
“smrBgm133GallonsGross/ smrBgm167GallonsGross “
and
“smrEgm133GallonsGross/ smrEgm167GallonsGross “
I added to the XCEL sheets 2 new form fields named
smrBgm167GrosGalnsDA/smrEgm167GrosGalnsDA
The above additons I made in EXCEL should ACTUALLy be named as
`smrBgm229GallonsGross/smrEgm229GallonsGross` because. This is a MUST for the Delphi application to function properly.
This Delphi-4 application extracts , and vewrifys the form DATA in tandem with the DB.
My Delphi-4 application works (checks/inserts/retrieves) so that current months beginning gallon of milk “bgm229” is equal to last months ending gallon of milk “egm229” , and then throw an exception if they are different.
Excel sheets:- Bgm167GrosGalnsDA/ Egm160GrosGalnsDA
Delphi Code (DB- input/ DB- output/validation):- bgm229/ egm229
SQL 2005 DB:- bgm167DA/ egm167DA
Actually the columns I ADDED should have been named asa "smrEgm133GallonsGross/ smrEgm167GallonsGross "...I messed up in naming them and they are on the production now....
In the Delphi procedure,for the beginning inventory, the code it is
ExtractFormBgmInfo(smrMilkAvMilk, 'smrBgm133');
ExtractFormBgmInfo(smrMilkDe, 'smrBgm167');
For ending inventory the code it is
ExtractFormEgmInfo(smrMilkAvMilk, 'smrEgm133');
ExtractFormEgmInfo(smrMilkDe, 'smrEgm167');
I am adding “smrBgm229GrosGalns/smrEgm229GrosGalns” to the list
But the issue is that they are named erroneously as “smrBgm167GrosGalnsDA/ smrEgm167GrosGalnsDA” IN THE EXCEL sheets, while they are to be named as 'smrBgm229/'smrEgm229''(as is the case in the Delphi code). Hence. I added ...to the above
ExtractFormBgmInfo(smrMilkAvMilk, 'smrBgm133');
ExtractFormBgmInfo(smrMilkDe, 'smrBgm167');
ExtractFormBgmInfo(smrMilkDyedDe, 'smrBgm229');
ExtractFormEgmInfo(smrMilkAvMilk, 'smrEgm133');
ExtractFormEgmInfo(smrMilkDe, 'smrEgm167');
ExtractFormEgmInfo(smrMilkDyedDe, 'smrEgm229');
This throws an error , as smrBgm229GallonsGross /smrEgm229GallonsGross are not defined in the EXCEL sheets .So the issue is how do I convert “smrBgm167GrosGalnsDA” from Excel sheets into “smrBgm229GallonsGross” and then make my “ExtractForm” statement correct?
Please help there is an release scheduled today and got to discuss this with my superirors
What you want to do is map one string to another. You can use a simple string list for that.
// Declare the variable somewhere, such as at unit scope or as a field
// of your form class
var
ColumnNameMap: TStrings;
// Somewhere else, such as unit initialization or a class constructor,
// initialize the data structure with the column-name mappings.
ColumnNameMap := TStringList.Create;
ColumnNameMap.Values['Bgm167 GrosGalns DA'] := 'bgm229/ egm229';
// In yet a third place in your code, use something like this to map
// the column name in your input to the real column name in your output.
i := ColumnNameMap.IndexOfName(ColumnName);
if i >= 0 then
RealColumnName := ColumnNameMap.Values[ColumnName]
else
RealColumnName := ColumnName;
Later versions of Delphi have the generic TDictionary class. Use TDictionary<string, string>. The TStrings solution I outlined above will have problems if any of the column names can have equals signs in them, but you can mitigate that by changing the NameValueSeparator property.
var
ColumnNameMap: TDictionary<string, string>;
ColumnNameMap := TDictionary<string, string>.Create;
ColumnNameMap.Add('Bgm167 GrosGalns DA', 'bgm229/ egm229');
if not ColumnNameMap.TryGetValue(ColumnName, RealColumnName) then
RealColumnName := ColumnName;