Message Image  

App Connect

DFDL: Modelling COBOL that uses comma as decimal point 

Tue July 14, 2020 10:02 AM

If you have a COBOL copybook that describes a message then you can use the IIB toolkit to import the copybook and create a DFDL message model. The toolkit importer uses default settings when importing a .cpy file, one of which is that a period (.) is the decimal point. If your message uses a comma (,) as the decimal point instead, then you need to include the copybook in a ‘wrapper’ COBOL program and change the decimal point setting using the SPECIAL-NAMES section. Here is an example, assuming the copybook is called ‘COPY1’: Make sure that the copybook and the wrapper program reside in the same directory, and the program has file extension .cbl.

IDENTIFICATION DIVISION.
PROGRAM-ID. WRAPPER.

ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
DECIMAL-POINT IS COMMA.
DATA DIVISION.
WORKING-STORAGE SECTION.
COPY COPY1.
END PROGRAM WRAPPER.

Also works for importing into a message set for MRM.


#DFDL
#COBOL
#IntegrationBus(IIB)
#IIBtoolkit
#AppConnectEnterprise(ACE)

Statistics

0 Favorited
33 Views
0 Files
0 Shares
0 Downloads

Comments

Tue February 23, 2021 04:52 AM

@amit Kapila I'm afraid the COBOL importer function of the New Message Model wizard only works on Windows.​

Mon February 22, 2021 05:46 PM

Operating System: # uname -a
Linux SATELLITE-L50D-B 5.3.0-64-generic #58-Ubuntu SMP Fri Jul 10 19:33:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

IBM Integration Toolkit

Version: 10.0.0.22
Build id: 10.0.0.22-20200824-1018

I am trying to define a message model. Why is the structure missing when I try to create a new DFDL from a COBOL copybook INVOICES.cpy?



This is what the INVOICES.cpy looks like:

01 INVOICES.
03 REQ-TYPE PIC X(5).
03 MACHINE-CODE PIC XX.
03 CachierId PIC X(12).
03 CUSTLastName PIC X(15).
03 CUSTFirstName PIC X(20).
03 CUSTCompany PIC X(20).
03 CUSTAddr1 PIC X(12).
03 CUSTAddr2 PIC X(12).
03 CUSTCity PIC X(10).
03 CUSTState PIC X(10).
03 CUSTCountry PIC X(5).
03 CUSTMail PIC X(20).
03 CUSTPhone PIC X(15).
03 CUSTDOB PIC X(8).
03 PurchaseCount PIC 9(3).
03 Purchase OCCURS 0 TO 21 TIMES
DEPENDING ON PurchaseCount.
04 PurchaseId PIC X(10).
04 ProductName PIC X(10).
04 Amount PIC 9(2).
04 Price PIC 9(8)V99.
03 RETURN-COMMENT PIC X(50).

What libraries are missing?