Highlighted
Absent Member.
Absent Member.
2778 views

Sorting a file using/giving, extsm.obj

Jump to solution

In NX3.1 we had to link extsm.obj (in Build Settings>Link>Advanced) for this sort to work:

sort sort-file

on ascending key srt-endpoint

  srt-cl-amt

  srt-kb-amt 

using tmp-file

giving tmp-file.

 

In Visual COBOL, the sort blows up.  Do we need to add the extsm.obj into the settings somewhere or is there another answer?

Please and Thank You. 

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Sorting a file using/giving, extsm.obj

Jump to solution

Customer opened support incident for this and the problem was determined to be caused by using SORT with USING/GIVING directly within a managed code object method.

The problem has been fixed by development and the fix will be available in a future release of Visual COBOL.

A workaround is to move the SORT statement to a procedural COBOL program and call this program from within the method instead of doing the SORT directly in the method.

View solution in original post

0 Likes
4 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Sorting a file using/giving, extsm.obj

Jump to solution

There is no separate extsm.obj to link in when using the sort statement in Visual COBOL.

I just tested this here and the sort worked fine in both native and managed code projects without adding anything.

Can you please define what you mean by "the sort blows up"?

What is the error message that you are receiving and are you using native code or managed code?

Thanks.

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Sorting a file using/giving, extsm.obj

Jump to solution

The select and fd definitions are:

 

SELECT SORT-FILE ASSIGN TO DYNAMIC LOCSRT

ORGANIZATION SEQUENTIAL

ACCESS IS SEQUENTIAL.

 

SELECT TMP-FILE ASSIGN TO DYNAMIC LOCTMP

ORGANIZATION LINE SEQUENTIAL

ACCESS IS SEQUENTIAL.

 

FD  TMP-FILE

BLOCK CONTAINS 0 RECORDS

RECORD CONTAINS 2056 CHARACTERS

LABEL RECORD IS STANDARD.

01  TMP-REC                    PIC X(2056).

 

SD  SORT-FILE.

01  SRT-REC.

05  FILLER                  PIC X(01).

05  SRT-CL-AMT         PIC 9(10)V99 COMP-3.

05  SRT-ENDPOINT    PIC 9(08).

05  FILLER                   PIC X(08).

05  SRT-KB-AMT          PIC 9(10)V99 COMP-3.

05  FILLER                    PIC X(2025).

 

the error on the sort is:

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Sorting a file using/giving, extsm.obj

Jump to solution

Which Visual COBOL release are you using?

Can you please open up a support incident for this issue as we will need to try to recreate it in-house using  a data file supplied by you.

I have a hunch that the problem might have to do with specifying the input file as line sequential with COMP-3 data in it but I will not know until I can actually run the application against your data file.

Thanks.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Sorting a file using/giving, extsm.obj

Jump to solution

Customer opened support incident for this and the problem was determined to be caused by using SORT with USING/GIVING directly within a managed code object method.

The problem has been fixed by development and the fix will be available in a future release of Visual COBOL.

A workaround is to move the SORT statement to a procedural COBOL program and call this program from within the method instead of doing the SORT directly in the method.

View solution in original post

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.