ECMap gives you the option to import a variety of application data formats. You can import record definitions from COBOL copybooks, ODBC data sources (such as Microsoft Access, Oracle, Sequel Server, and Excel), delimited flat files, other maps, etc. ECMap also allows you to import record definitions from HTML and XML formats.
Export options are also available for ODBC databases, HTML, and XML.
The ability to import record definitions eliminates the manual step of re-keying the information –saving time and money and preventing the introduction of errors.
Import the file definition from a COBOL copybook. The purchase order file produced by the purchasing system consists of two records whose descriptions are contained in a COBOL copybook called ORDERS.CBL. The format of the COBOL copybook displays below.
ORDERS.CBL01 ORDER-HEADER. 10 REC-TYPE PIC X(1). 10 VENDOR-NO PIC X(12). 10 PO-DATE PIC 9(8). 10 PO-NO PIC X(22). 10 CONTRACT-NO PIC X(9). 10 SHIP-TO-DUNS PIC X(13). 10 PO-LINE-NO PIC X(2). 10 PROCESSED PIC X(1). 10 FILLER PIC X(50).01 ORDER-DETAIL. 10 REC-TYPE PIC X(1). 10 PO-NO PIC X(22). 10 QTY PIC 9(4). 10 UOM PIC X(2). 10 DESCRIPTION PIC X(50). 10 ITEM-NO PIC X(12). 10 STOCK-LOC PIC X(4). 10 UPC-NO PIC X(12). 10 ITEM-PRICE PIC 9(5)v99. 10 FILLER PIC X(50).
The data file produced by the purchasing system, ORDERS.SEQ, contains the purchase order data that is mapped to the X12 850 Transaction Set. The file that is used in this exercise contains data for two purchase orders, as shown below:
ORDERS.SEQ A24680 19990109PO1133557799-1 98-100010027364321 4Y CPO1133557799-1 160EA233MHz Upgrade chip 11410-CP A310900123456890 19800 CPO1133557799-1 8DZ100MB Zip Disk 21410-ZD A311520098345690 15700 CPO1133557799-1 32EAPowerEdge 6300 400MHz 31420-CP A312100034201120 65399 CPO1133557799-1 16EAUltra ATA/66 8.4 GB Hard Drive 41420-HD A313090035201127 19350 A24680 19990109PO321335577-1 98-301010023364990 3Y CPO321335577-1 20EA333MHz Upgrade 11409-CP A310990412345688 7998 CPO321335577-1 8EAPowerEdge 6300 400MHz 31420-CP A312100034201120 19350 CPO321335577-1 32DZZip Disks 100MG 21409-ZD A315050903420190 9900
Importing a data definition from COBOL
From the Application Files menu on the main ECMap window, select Import Definition. Then select COBOL from the Import Definition submenu. The COBOL Record Definition Import window displays. ECMap automatically populates the Project and Map names.
Select Browse next to the COBOL Definition Import File/File Name. The Choose COBOL Import File window displays.
Locate the file c:\Program Files\Sybase\ECMap\maps\data\orders.cbl and double-click it.
You return to the COBOL Record Definition Import window, and the program automatically enters it in the COBOL Definition Import File/File Name text box.
This specifies the location of the file containing the COBOL record definitions – orders.cbl.
In the Options section of the window, select Add Application Record, File Name, and Directory.
This populates the File Location/File Name and the File Location/Directory with the file name and directory path of the imported record definition.
In the File Location section of the window, select in the File Name text box and change orders.cbl to orders.seq.
This specifies the location of the file containing the COBOL application data - orders.seq.
Select Continue.
If a file with this name does not exist, the New File window displays. Go to Step 7. If a file with this name already exists, the Select COBOL Records window displays. Go to Step 9. (A file with this name would already exist, for example, if you repeat this sequence of steps or if you have used the ECMap training manual.)
On the New File window, ECMap automatically enters the File Name. Select SEQUENTIAL-ASCII as the File Type from the drop-down list.
The File Description is an optional field. Select OK. The Select COBOL Records window displays.
On the Select COBOL Records window, select ORDER-DETAIL, hold down Shift and select ORDER-HEADER to select both records.
Select LOAD. If you have previously loaded the record definitions, you are asked to confirm that you want to overwrite the application file records. Select Yes. The View Log dialog box appears with the message “Run Complete”. The records have been imported into ECMap, and they are associated with the file orders.seq. The file orders.seq is associated with the directory c:\..\data. Select Yes.
You return to the COBOL Import Log window displays, with a listing of the extracted records and a summary of any syntax errors in the file. Select OK. The excobol dialog box displays, with the message “Extract Run Completed Successfully”. Select OK.
The COBOL Record Definition Import window displays. Select X in the upper right corner of the window to return to the main ECMap window.
Adding field attributes to the imported COBOL
data
Select Records/Tables on the toolbar or Workspace. The Records/Tables window displays, with the two records you imported - ORDER-DETAIL and ORDER-HEADER.
Double-click ORDER-HEADER to display the fields in the header record.
Select the REC-TYPE field to select it. From the Field menu at the top of the window, select Properties. The Field Properties window for the REC-TYPE field displays. It has two tabs – Fields and Options. ECMap automatically populates the text boxes on the Fields tab – Record Name, Field Name, Field Description, Start Position, Field Length, and Field Type.
The “record type” field property associates an application data record with a layout. In this example, we assign “A” as the record type for a header record. This is an arbitrary choice, and you may assign any unique value you choose.
Select the Options tab to make it active, and then select the check box next to Record Type. Type A in the Record Type text box. Select Next to view the next field in the record.
The Field Properties window for the VENDOR-NO field displays. Select the Options tab to make it active, and then select the check box next to Trading Partner ID. Select Next to view the next field in the record.
The VENDOR-NO field is used to retrieve information from the trading partner file to build the X12 envelopes that surround the transaction. It is the internal value in the application data that identifies to whom the data is being sent.
The Field Properties window for the PO-DATE field displays. In the Field Type on the Fields tab, select DT-Date from the drop-down list. Two additional text boxes appear – Date Format and Century Minimum Type.
COBOL date fields are imported with a Field Type of UI. They must be changed to DT and a date format selected.
In the Date Format field, select YYYYMMDD from the drop-down list. In the Century Minimum Type field, select Use global century minimum
The Y2K logic in ECMap allows the default value specified in the Map definition process to be overridden on a field by field basis.
Select OK to return to the Records/Tables window.
Close the ORDER-HEADER record by selecting the minus sign next to it. Double-click the ORDER-DETAIL record to display the fields in the detail record.
Select the REC-TYPE field to select it. From the Field menu at the top of the window, select Properties. The Field Properties window for the REC-TYPE field displays.
The “record type” field property associates an application data record with a layout. In this example, we assign “C” as the record type for a detail record. This is an arbitrary choice, and you may assign any unique value you choose.
Select the Options tab to make it active, and then select the check box next to Record Type. Type C in the Record Type text box.
Select OK to return to the Records/Tables window. From the File menu on the Records/Tables window, select Close to return to the main ECMap window.
Creating a customized transaction set
ECMap comes pre-loaded with information about the ANSI X12, UN EDIFACT, and HL7 standards. When you select a transaction, ECMap already knows which segments are mandatory and which are optional.
Annual upgrade subscriptions quickly provide you with changes almost as soon as they are released.
ECMap’s optional SEF (Standard Exchange Format) Utility further automates the mapping process by allowing you to automatically import implementation guides from your trading partners.
Bundled standards, timely upgrades, the SEF utility – all these features help to reduce the time required for both development and maintenance.
With ECMap, it is easy to create a customized transaction set based on your implementation guide. The full X12 transaction set displays in the Create Transaction window. Simply check the segments you want to include and tell ECMap to “make” the transaction.
For our transaction, we include the following segments in the 850 Transaction Set: ST, BEG, N1, PO1, and SE.
From the Build menu on the main ECMap window, select Create Transaction. The Create Transaction- 850 Purchase Order window appears.
The mandatory segments ST, BEG, PO1, and SE are already checked.
To select N1, you must first locate it. To quickly locate the N1 segment, choose Find from the Edit menu. When the Find dialog box displays, enter N1 in the Search text box and select Find. The program automatically takes you to the first N1 segment. (There are four N1 segments.) Select the N1 check box to select it. (Be sure not to check the N1 loop, but only the N1 segment. If you check the loop, all of the segments within the loop are checked.)
From the File menu on the 850 Purchase Order window, select Make Transaction. The transaction is created, and the Mapping – Application to X12 window displays. The left section of the window is Source: Application Data and the right section of the window is Destination: X12. The bottom of the window is the Mapping section.
Mapping the source data to the destination data
Mapping in ECMap is an easy drag-and-drop procedure. ECMap automatically populates some elements from information you entered. In this example, ECMap maps the SE and the ST segments. Map the BEG, N1, and PO1 segments by simply dragging record fields from our application data and dropping them onto the appropriate elements. ECMap has a feature that allows you to globally ignore any elements that do not have to be mapped.
To make sure that you have “grabbed” the element that you want to drag-and-drop, a small icon of a page must appear when you highlight the element. If the small page icon does not appear until after your cursor moves onto the section of the window with application data, you did not “grab” the element and you cannot drop it onto a record field to map the element to the field.
As data is mapped to elements, the yellow circles next to the elements turn green. The most recently mapped record field has a check mark next to it. And the mapping assignments are displayed in the bottom section of the mapping window.
To quickly locate a code, select any entry in the Value column and type the code you want to locate. Or you can use the Find command in the Edit menu. In either case, ECMap automatically displays the highlighted code.
By giving you a graphical view of your mapping and the business rules you have used, ECMap makes it easy for you to review the work you have completed.
Map the BEG segment:
On the Destination: X12 section of the Mapping - Application to X12 window, double-click the BEG segment.
The elements associated with the BEG segment are displayed.
Right-click BEG 01 (Transaction Set Purpose Code) to display a drop-down menu. From the menu, left-click Full Code List to select it.
The Full Code List for Element 353 displays, superimposed over the left section of the window.
Click, hold, and drag the code Value 00 (not the Code Description Original) from the Full Code List for Element 353 section and drop it on BEG 01 in the Destination: X12 section. In the Mapping section at the bottom of the window, STRVAR appears under Record and 00 appears under Field Name.
Right-click BEG 02 (Purchase Order Type Code) to display a drop-down menu. From the menu, left-click Full Code List to select it. The Full Code List for Element 92 appears on the left section of the window.
Click, hold, and drag the code Value SA (not the Code Description Stand-alone Order) from the Full Code List for Element 92 section and drop it on BEG 02 in the Destination: X12 section. In the Mapping section, STRVAR appears under Record and SA appears under Field Name.
Right-click BEG 03 (Purchase Order Number) to display a drop-down menu. From the menu, left-click Record/Field from to select it.
The two records ORDER-DETAIL and ORDER-HEADER display in the Source: Application Data section of the window.
Double-click the ORDER-HEADER record to display the fields in the record.
Click, hold, and drag the field PO-NO from the Source: Application Data section and drop it on BEG 03 (Purchase Order Number) in the Destination: X12 section. In the Mapping section, ORDER-HEADER appears under Record and PO-NO appears under Field Name.
Close the BEG segment by selecting the minus sign next to it.
Mapping the N1 segment
On the Destination: X12 section of the Mapping – Application to X12 window, double-click the N1 segment. The elements associated with the N1 segment are displayed.
From the View menu at the top of the window, select Segment Detail.
The Segment window displays. Highlight the N1 Level. From the Edit menu, select Properties. The Segment Properties N1 window displays. In the Loop text box, delete N1. In the Depth text box, change 1 to 0. Select OK. From the File menu on the Segment window, choose Close to return to the Mapping – Application to X12 window.
On outbound maps, the loop and level structure must
sometimes be changed to allow ECMap to create the map flow automatically.
Right-click N1 01 (Entity Identifier Code) to display the drop-down menu. From the menu, left-click Full Code List to select it. The Full Code List for Element 98 appears on the left section of the window.
ECMap contains the full code list for every element
in every transaction in every version of X12 that is shipped with
the product.
Click, hold, and drag the code Value ST (not the Code Description Ship To) from the Full Code List for Element 98 section and drop it on N1 01 in the Destination: X12 section. In the Mapping section at the bottom of the window, STRVAR appears under Record and ST appears under Field Name.
Right-click N1 03 (Identification Code Qualifier) to display the drop-down menu. From the menu, left-click Full Code List to select it. The Full Code List for Element 66 appears on the left section of the window.
Click, hold, and drag the code Value 1 (not the Code Description D-U-N-S Number, Dun & Bradstreet) from the Full Code List for Element 66 section and drop it N1 03 in the Destination: X12 section. In the Mapping section at the bottom of the window, STRVAR appears under Record and 1 appears under Field Name.
Right-click N1 04 (Identification Code) to display the drop-down menu. From the menu, left-click Record/Field to select it. The two records ORDER-DETAIL and ORDER-HEADER display again in the Source: Application Data section of the window. If the fields of the ORDER-HEADER record are not displayed, double-click ORDER-HEADER.
Click, hold, and drag the field SHIP-TO-DUNS from the Source: Application Data section and drop it on N1 04 in the Destination: X12 section. In the Mapping section, ORDER-HEADER appears under Record and SHIP-TO-DUNS appears under Field Name.
Close the N1 segment by selecting the minus sign next to it.
Mapping the PO1 segment
On the Destination: X12 section of the Mapping– Application to X12 window, double-click the PO1 segment. The elements associated with the PO1 segment are displayed.
Close the ORDER-HEADER record by selecting the minus sign next to it. Double-click the ORDER-DETAIL record to display the fields in the record.
Click, hold, and drag the field QTY from the Source: Application Data section and drop it on PO1 02 (Quantity Ordered) in the Destination: X12 section. In the Mapping section, ORDER-DETAIL appears under Record and QTY appears under Field Name.
Click, hold, and drag the field UOM from the Source: Application Data section and drop it on PO1 03 (Unit or Basis for Measurement Code) in the Destination: X12 section. In the Mapping section, ORDER-DETAIL appears under Record and UOM appears under Field Name.
Click, hold, and drag the field ITEM-PRICE from the Source: Application Data section and drop it on PO1 04 (Unit Price) in the Destination: X12 section. In the Mapping section, ORDER-DETAIL appears under Record and ITEM-PRICE appears under Field Name.
Right-click PO1 06 (Product/Service ID Qualifier) to display the drop-down menu. From the menu, left-click Full Code List to select it. The Full Code List for Element 235 appears on the left section of the window.
Click, hold, and drag the code Value VN (not the code Description Vendor’s (Seller’s) Item Number) from the Full Code List for Element 235 section and drop it on PO1 06 in the Destination: X12 section. In the Mapping section at the bottom of the window, STRVAR appears under Record and VN appears under Field Name.
Right-click PO1 07 (Product/Service ID) to display the drop-down menu. From the menu, left-click Record/Field to select it.
Click, hold, and drag the field ITEM-NO from the Source: Application Data section and drop it on PO1 07 in the Destination: X12 section.
Close the PO1 segment by selecting the minus sign next to it.
Ignoring unmapped elements
Once you have mapped the necessary fields, ECMap gives you the option of ignoring the rest of the unmapped elements. You ignore elements because you do not need them for this map or because ECMap automatically fills these elements.
From the Segment menu at the top of the Mapping - Application to X12 window, select Ignore. From the Ignore submenu, select All.
A Confirm dialog box displays, with the following message: “Mark all uninitialized elements as IGNORE?” Select YES. In the Mapping section, IGNVAR now appears under Record and IGNORE appears under Field Name for all previously unmapped elements.
From the File menu on the Mapping- Application to X12 window, select Close to return to the main ECMap window.
Creating the map flow
Map flow is the heart of ECMap, mirroring the relationship between input and output and defining the context of data at each point in the mapping cycle.
Map flow gives you the flexibility you need to adapt any business transaction to your application format.
The map flow defines the relationship between the application data and the segments in the X12 transaction set.
To toggle between checking and unchecking an option, simply select the option.
Select Map Flow on the toolbar or Workspace. The Outbound Map Flow window displays. From the Options menu, select Multiple Files to uncheck it. From the File menu, choose Create Flow.
If you have previously created flow for this map, a Confirm dialog box displays, asking whether you want to “Delete existing flow and build new default flow?” Go to Step 2. (You would have already created the flow, for example, if you are repeating these steps.) If this is the first time you have created flow for this map, go to Step 4.
If you answer NO to the question “Delete existing flow and build new default flow?”, the Outbound Map Flow window displays with a diagram of the flow you created previously - including rules, next level, and break level. Go to Step 5. If you answer YES, the Rule Number Control window displays.
On the Rule Number Control window, select Delete All Rules under Rule Number Delete Option. Select OK.
A Success dialog box displays, with the message “Flow Creation Complete”. Select OK and a diagram of the flow created by ECMap displays on the Outbound Map Flow window - with the IO Rule, Before Rule, After Rule, Next Level, and Break Level shown in the bottom section of the window.
From the File menu on the Outbound Map Flow window, choose Close to return to the main ECMap window.