AcuSort - determining field parameters

0 Likes

Problem:

AcuSort uses field parameters offset, length, type, and order.  

The offset and length are easy to determine if the field is at or near the beginning of the record and there is no packed data.  What if the field to be sorted on is somewhere in the middle of a very large record?  

Is there a simple way to determine the field parameters?

Resolution:

Generate an extended file descriptor (XFD) for the file by using the -Fx compile option.  

The 'Field Section' of the XFD includes the details about each field.

Column one is the offset in bytes.

Column two is the size in bytes.

Column three is the data type.

For example, to sort ascending on the field MORE-DATA that has this XFD description:

0000001892,0000000006,16,0000000006, 00,000,000,03, MORE-DATA

(The offset is 1892 the size is 6 and the type is 16.)

The AcuSort command would be:  

     acusort sort fields (1892, 6, CH, A)

This table relates the XFD type code to the AcuSort type code:

XFD  AcuSort

00    CH  Alphanumeric

01    NU  Unsigned numeric

02    TS  Signed numeric, SIGN IS TRAILING SEPARATE

03    TI  Signed numeric, SIGN IS TRAILING

04    LS  Signed numeric, SIGN IS LEADING SEPARATE

05    LI  Signed numeric, SIGN IS LEADING  

06    SB  Signed numeric, USAGE COMP

07    BI  Unsigned numeric, USAGE COMP

08    C6  Unsigned numeric, USAGE COMP-6

09    PD  Signed numeric, USAGE COMP-3

10    C6  Unsigned numeric, USAGE COMP-6

11    SB  Signed numeric, USAGE COMP

12    CX  Usage COMP-X

13    S5  Signed numeric, USAGE COMP-5

14    C5  Unsigned numeric, USAGE COMP-5

16    CH  Alphanumeric

17    CH  Alphanumeric

18    CH  Alphanumeric

19    CH  Alphanumeric

20    CH  Alphanumeric

23    FL  Usage floating point

  

See Section 5.3.4.4 of the AcuCOBOL-GT User's Guide for more information on the XFD Field Section.

Old KB# 2660
Comment List
Anonymous
Related Discussions
Recommended