Commodore
Commodore
1570 views

Passing a record from native to managed

Jump to solution

I'm passing this ISAM file record from native to managed, using com-interop:

          03  RHS-REF-TRANS-HIST.
           05  RHS-REF-TRANS-HIST-KEY.
             10  RHS-TYPE-REC-ID       PIC X.
               88  RHS-TYPE-REC        VALUE "R".
             10  RHS-ENTY-CODE         PIC XX.
             10  RHS-FSCL-YR           PIC XX.
             10  RHS-REF-INFO.
               15  RHS-FNCL-ACCT       PIC XX.
               15  RHS-DEP-WTD-IND     PIC X.
               15  RHS-REF-SEQ-NO      PIC X(5).
             10  RHS-AREA-ACCT-INFO.
               15  RHS-AREA-CODE       PIC X.
               15  RHS-ACCT-NAME       PIC X(15).
             10  RHS-SUBSID-ACCT       PIC X(10).
             10  RHS-ITEM-NO           PIC S9(3)  COMP-3.
             10  RHS-FSCL-MO           PIC XX.
             10  FILLER                PIC X(7).
           05  RHS-REF-TRANS-HIST-DATA.
             10  RHS-ENTRY-TYPE        PIC X.
             10  RHS-TRANS-DATE        PIC S9(7)  COMP-3.
             10  RHS-TRANS-ID          PIC X(3).
             10  RHS-ENTP-INFO.
               15  RHS-ENTP-YR         PIC XX.
               15  RHS-ENTP-LVL1       PIC X(8).
               15  RHS-ENTP-LVL2       PIC X(8).
             10  FILLER                PIC X(3).
             10  RHS-EXCL-CASH-FLOW    PIC X.
             10  RHS-DB-CR-IND         PIC X.
             10  RHS-TAX-CODE          PIC X(7).
             10  RHS-PAYEE-CODE        PIC X(4).
             10  RHS-ITEM-AMT          PIC S9(9)V99 COMP-3.
             10  RHS-QUANT-INFO.
               15  RHS-UNIT-QUANT1     PIC S9(9)V99 COMP-3.
               15  RHS-UNIT-ABV1       PIC X(3).
               15  RHS-UNIT-QUANT2     PIC S9(9)V99 COMP-3.
               15  RHS-UNIT-ABV2       PIC X(3).
             10  RHS-TO-FROM-DESC      PIC X(17).
             10  RHS-ADDL-INFO         PIC X(17).

I am using the method from this link for passing a a record as a string:

http://community.microfocus.com/microfocus/cobol/visual_cobol/f/18/t/11760.aspx.


I receive it as a string in my managed class and then set RHS-REF-TRANS-HIST to it.  So far it has worked ok.

Could the string ever get terminated by certain characters, such as null values  in the COMP-3 or  PIC X fields?

Phil Levin

Tags (1)
0 Likes
1 Solution

Accepted Solutions
Commodore
Commodore

I took this up with Support and it should be OK.  Groups are passed as BSTR types which are composed of a string length field and the actual string value.  These are not null terminated strings.

Phil Levin

View solution in original post

0 Likes
2 Replies
Commodore
Commodore

Correction - null values won't be showing up in any of these fields but they may sometimes be set to low-values.

Phil Levin

0 Likes
Commodore
Commodore

I took this up with Support and it should be OK.  Groups are passed as BSTR types which are composed of a string length field and the actual string value.  These are not null terminated strings.

Phil Levin

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.