EDIdEv - Electronic Data Interchange Development      EDIdEv


 
Frequently Asked Questions

  EDI Tool for Developers

How do I stop FREDI from using its internal Standard Reference Library, and make it only use the SEF files I provide it?
The internal Standard Reference Library can be disabled by setting the "EnableStandardReference" property of the ediSchemas object to false before loading the SEF file(s). For example:

Set oEdiDoc = New Fredi.ediDocument
Set oSchemas = oEdiDoc.GetSchemas
oSchemas.EnableStandardReference = False

oEdiDoc.LoadSchema sSefFile, 0




I got an error message "DESCRIPTION:Failed to add segment 'PO1' at loop instance '2'.][CODE:13112]" when I tried to create a segment in the second instance of the PO1 loop e.g. PO1(2)\PO1. However, it successfully created PO1(1)\PO1. What could be the problem?
This error is quite deceiving and is normally caused by a segment which was created earlier by the "CreateDataSegment" method with a wrong syntax. For example, the above error (while generating the PO1 segment) may have been caused by an earlier code that generated an N1 segment, which was syntactically wrong. (e.g. an "N1" string was entered, rather than the "N1\N1" string to denote that the N1 segment was in a loop).

ISA
GS
ST
BAK
REF
N1 ------------------- CAUSE OF PROBLEM (SHOULD BE N1\N1)
PO1(1)\PO1
PO1(1)\CTP
PO1(1)\CTP(2)
PO1(1)\SDQ
PO1(2)\PO1 ----- FAILED HERE



How do I detect/include special character terminators in an EDI file?
Special characters must be represented in their ASCII value enclosed in squiggly "{" brackets. If it is made up of multiple characters, then the ASCII characters must be separated by a colon ":" and enclosed in squiggly brackets.
For example, to represent the carriage return-linefeed pair as a segment terminator, the code would look like:

oInterchange.SegmentTerminator = {13:10}


Which files of FREDI are distributable with my program?
In FREDI 4, the following files are distributable as part of your program. Please read the help documentation of your current FREDI version to get a more updated list. (Also note that to facilitate your deployment, we have povided executable FREDI Runtime License installers, which will install these files.)

edidev_sec.dll
edidev_usa.dll
edidev_service.dll
edidev_comm.dll
edidev_core.dll
edidev_unded.dll
edidev_x12ded.dll
edidev_Dictionary.edb
edidev_Dictionary.dll
edidev_sef.dll
edidev.dll
edidevctl.ocx
Fredi.dll

(edidev_unded.dll, edidev_x12ded.dll, edidev_Dictionary.dll, edidev_sef.dll, edidev.dll, edidevctl.ocx and fredi.dll must be registered into Windows O/S using regsvr32.exe). These files must be installed and registered in the order that they are listed. And all FREDI distributable files must be located together in the same directory.

The following Windows systems files must also be present in the Windows System directory to successfully install and run the distributable files of FREDI.

ASYCFILT.DLL (2.40.4275.1)
COMCAT.DLL (4.71.1441.1)
Comctl32.ocx (6.0.80.22)
Comdlg32.ocx (6.0.84.18)
MFC42.DLL (6.0.8447.0)
MSINET.OCX (6.0.88.62)
MSVCRT.DLL (6.0.8397.0)
OLEAUT32.DLL (2.40.4275.1)
OLEPRO32.DLL (5.0.4275.1)
scrrun.dll (5.1.0.4615)
STDOLE2.TLB (2.40.4275.1)
REGSVR32.EXE (5.0.1641.1)
MSVCP60.DLL (6.0.8972.0)

(If not deploying with a FREDI Runtime License, please see your FREDI developers license agreement for any fees associated with distributing the Framework EDI components.)

How do I generate multiple Transaction Sets in one Functional Group?
To generate another transaction set in a group, simply call the oGroup.CreateTransactionset() method again. For example below.


'Create Interchange
set oInterchange = oEdiDoc.CreateInterchane("X","004010")
oSegment.DataElementValue(1) = ...
oSegment.DataElementValue(2) = ...
'etc....

'Create Functional Group
set oGroup = oInterchange.CreateGroup("004010")
oSegment.DataElementValue(1) = ...
oSegment.DataElementValue(2) = ...
'etc...

'Create first Transaction Set
set oTransactionset = oGroup.CreateTransactionset("810")
Set oSegment = oTransactionset.GetDataSegmentHeader
oSegment.DataElementValue(1) = "810"
oSegment.DataElementValue(2) = "0001"

'Create all other segments for first Transaction Set
Set oSegment = oTransactionset.CreateDataSegment("BIG")
oSegment.DataElementValue(1) = ...
'etc...

'Create second Transaction Set
set oTransactionset = oGroup.CreateTransactionset("810")
Set oSegment = oTransactionset.GetDataSegmentHeader
oSegment.DataElementValue(1) = "810"
oSegment.DataElementValue(2) = "0002"

'Create all other segments for second Transaction Set
Set oSegment = oTransactionset.CreateDataSegment("BIG")
oSegment.DataElementValue(1) = ...
'etc...

'Save EDI document
oEdiDoc.Save "850Output.X12"

Download sample VB program that generates multiple Transaction Sets


When I try to open my EDI file using the eFileManager I get a severe error about segment UNB, but my file is an X12 file with no UNB segment.
This error can be caused by an EDI X12 file that does not have the X12 envelope data segments (ISA, GS).  The file is then mistakenly treated by the eFileManager as a UN/EDIFACT file further causing the error.


I have an EDI file with multiple groups of different Transaction Sets and Version, is it possible to load multiple SEF files in FREDI?
Yes, it is possible to load multiple SEF files in FREDI, and it can be done in two ways:
1. Simply call the "LoadSchema" method as many times as the number of SEF files that needs to be loaded. For example:
oEdiDoc.LoadSchema "850_4010.SEF",0
oEdiDoc.LoadSchema "810_4030.SEF",0

2. Or, if the SEF files are of the same version, the SEF files can be combined together by including the .SETS section of one SEF file into another. This can be done by using any text editor. However, this method is only possible if the Transaction Sets are of the same version.

An example of a SEF file with multiple Transaction Sets


If I load multiple SEF files with different versions, how does FREDI select which SEF file to use when parsing an EDI file?
FREDI gets the eighth data element of the GS segment (GS08) and matches it with the third data of the.INI section of the SEF file. If it matches, FREDI will use that particular SEF file for parsing the EDI file. For example, if you load multiple 820 SEF files that have these three different versions:
If EDI file GS08 has "003040", then it will use the SEF file that has "003 040" as its third data of the INI section.
If EDI file GS08 has "004020VICS", then it will use the SEF file that has "004 020 VICS" as its third data of the INI section.
if EDI file GS08 has "004010X061", then it will use the SEF file that has "004 010 X061" as its third data of the INI section.


What happens if FREDI does not find a correct version SEF file from any that were loaded?
If FREDI does not find a SEF file that matches the EDI file, then FREDI will use its internal Standard Reference Library (SRL) to find the closest schema to parse the EDI file. This should be avoided at this time because the process of loading the SRL is slow and cumbersome. (In fact, we recommend that the SRL be disabled.) If the SRL is disabled, then FREDI will use the SEF file (from among those that were loaded) with a version closest to the EDI file.

I noticed that HIPAA 278 X094 has two implementation guidelines (Request, and Response) or 2 SEF files which have the same schema name (278 X094). If I load both these SEF files into FREDI, how would FREDI know which schema to use to process an EDI file since both have the same message ID and version?
In this case, FREDI can't automatically determine the correct schema to use, so FREDI must be instructed to select the correct SEF file by a value in the EDI file. The SEF files can be determined by their implementation name, which is the first data in the .INI section of the SEF file. For example, the implementation name of a SEF file with the following .INI information would be 278_X094Request

.INI
278_X094Request,,004 010 X094,X,X12-4010,

To instruct FREDI to load this particular SEF file when an EDI file has a certain value, you would have to include in the Version parameter of the LoadSchemBySetValue method of the ediSchema object, the implementation name together with the version separated by a backslash. For example, the syntax to load the 278_X094 Request SEF file when an EDI file has a BHT segment with its second data element having a value of ‘13”, would be

oSchemas.LoadSchemaBySetValue "278", "BHT", 2, 0, "13", "004 010 X094\278_X094Request"

And to instruct FREDI to load the 278_X094 Response SEF file when an EDI file has a BHT segment with its second data element having a value of “11” would be

oSchemas.LoadSchemaBySetValue "278", "BHT", 2, 0, "11", "004 010 X094\278_X094Response"


Example:
Set oEdiDoc = New Fredi.ediDocument
Set oSchemas = oEdiDoc.GetSchemas
oSchemas.LoadSchemaBySetValue "278", "BHT", 2, 0, "11", "004 010 X094\278_X094Response"
oSchemas.LoadSchemaBySetValue "278", "BHT", 2, 0, "13", "004 010 X094\278_X094Request"

oSchemas.EnableStandardReference = False
oEdiDoc.LoadSchema sPath & "278_X094.SEF", 0
oEdiDoc.LoadSchema sPath & "278_X094Request.SEF", 0
oEdiDoc.LoadSchema sPath & "278_X094Response.SEF", 0

oEdiDoc.LoadEdi sEdiFile


Sample Hipaa 278 Response/Request program


I’m using Visual Studio “Packaging and Deployment Wizard” to create an installation for my application that’s using the Framework EDI component. However when I deploy it, I get an error about the OCX file.
The error was caused because the setup was trying to register the OCX file before the other dependant dll files, or that some dll files were missing. Make sure you have the following files included in your setup:

edidev_sec.dll
edidev_usa.dll
edidev_service.dll
edidev_comm.dll
edidev_core.dll
edidev_unded.dll
edidev_x12ded.dll
edidev_Dictionary.edb
edidev_Dictionary.dll
edidev_sef.dll
edidev.dll
edidevctl.ocx
Fredi.dll

Also, make sure to register the self-registering files in this order:

edidev_unded.dll
edidev_x12ded.dll
edidev_Dictionary.dll
edidev_sef.dll
edidev.dll
edidevctl.ocx
fredi.dll

The SETUP.LST created by Visual studio can be viewed and edited with any text editor
Sample of a SETUP.LST file


I’ve created an installation for my application that has the FREDI distributable files; but when I deploy it, I get the 'nag' box indicating that I’m using an evaluation copy of FREDI, even though I have a valid serial number.
This problem occurs when the 'Edidev_Dictionary.edb' file is not installed in the same directory with the other FREDI distributable files. This usually happens with users that are using Visual Studio 'Packaging and Deployment Wizard' to create their installation program. By default, the SETUP.LST created by the wizard has the Edidev_Dictionary.edb installed in the application directory (AppPath), while installing the other FREDI distributable files separately into the system directory (WinSysPath). This must be corrected so that the Edidev_Dictionary.edb should be installed with the other FREDI distributable files in the system directory (WinSysPath). Another problem, with the SETUP.LST is that the FREDI distributable files are not in the order of how they should be installed. This would cause an error because some files are dependent on others. This must be corrected so that the FREDI files are installed in the order shown below. The SETUP list can be edited using a text editor.

The distributable files must be installed in the order shown, and all files must reside in the same folder.

edidev_sec.dll
edidev_usa.dll
edidev_service.dll
edidev_comm.dll
edidev_core.dll
edidev_unded.dll
edidev_x12ded.dll
edidev_Dictionary.edb
edidev_Dictionary.dll
edidev_sef.dll
edidev.dll
edidevctl.ocx
Fredi.dll

-------------

To avoid the above problems and make deployment easier, we have provided a Runtime License, which installs all the necessary FREDI distributable files automatically. Please see http://www.edidev.com/distributable.htm
Sample of a SETUP.LST file


Is it possible to generate and validate an EDI file at the same time just so that I know the EDI file created has no error before I send it?
Yes. During the EDI file creation, errors detected (that do not break the program) get saved into the ediWarnings object. The warnings object can then be interrogated to get the count and descriptions of these errors. For example (VB6 code).


'Saves the EDI file
oEdiDoc.Save sPath & sEdiFile

Dim oWarnings As Fredi.ediWarnings
Dim oWarning As Fredi.ediWarning

'instantiate warnings object
Set oWarnings = oEdiDoc.GetWarnings

'if warnings count is greater than 0, then error found.
For i = 1 To oWarnings.Count
Set oWarning = oWarnings.Warning(i)
ListErrors.AddItem oWarning.Description
Next

However, since creating EDI files are under your control (and thus their integrity can be managed by you) the FREDI component does not try to validate all errors during the EDI file generation so as to improve its speed performance. For example, testing for relational conditions does not occur during file generation. Also, some errors that are detected get corrected when the EDI file gets generated. For example, elements that do not meet the minimum length requirement are padded with spaces to meet the length size.

The best and more accurate way of validating an EDI file is to actually read it (load it) back into the FREDI component, and then interrogate the warnings object.

oEdiDoc.ImportSchema sSefFile, 0
oEdiDoc.LoadEdi sEdiFile

Set oSegment = oEdiDoc.FirstDataSegment
While Not oSegment Is Nothing
Set oSegment = oSegment.Next
Wend

Set oWarnings = oEdiDoc.GetWarnings
For i = 1 To oWarnings.Count
Set oWarning = oWarnings.Warning(i)
ListErrors.AddItem oWarning.Description
Next

Sample program that generates an EDI file and checks for errors


Is there a way to retrieve a data segment in an EDI file as is (with all its data and terminators)?
Yes. The method to return a complete data segment (including all its data element terminators) is to call the SegmentBuffer method of the ediDataSegment object. Example:

sSegmentLine = oSegment.SegmentBuffer

What is the method to return the loop number?
The LoopID method of the ediDataSegment object returns the loop number of where the segment is in. Example:

sLoopNumber = oSegment.LoopID

I want to be able to create multiple EDI files, but I'm hoping to do this without having to reload the SEF files since they are all of the same Transaction Set. Is this possible?
Yes, it is possible. You can use the 'New" method of the ediDocument object to clear the ediDocument object without clearing or destroying the schema that was loaded into it. This allows you to reuse the ediDocument object to create another EDI file without having to load the SEF file again. Example:

oEdiDoc = createobject("fredi.ediDocument")
oSchema = oEdiDoc.LoadSchema(sSef,0)

'start loop to create EDI files of same schema here

oEdiDoc.New

'code to create EDI file
...
Sample FoxPro program that generates multiple EDI files


Is there a method to display a progress bar while FREDI is loading an EDI file?
Yes, you can program a progress bar by capturing the events of the ediDocument object that occur during times when FREDI is processing an EDI file. You can interrogate the following events:

ProgressStart
ProgressUpdate
ProgressComplete

Download a sample VB program that shows a progress bar


Why is it that when I load my EDI file into the eAnalyzer, it detects errors in the EDI file; but when I load up the EDI file into the eFileManager, no errors are detected?
By default, the settings of the eFileManager are not enabled to validate codes and relation conditions in an EDI file. However, these settings can be enabled by clicking on the "options" button, and then selecting on their check boxes before loading the EDI file.


The eFilemanager option screen


What's the difference between the cursor type: Forward Only, and Dynamic. And how does the Forward Only cursor type improve performance?
The difference between the Dynamic and the ForwardOnly cursor type occurs when the ediDocument.LoadEdi method gets called. In Dynamic Cursor type, the component automatically reads the entire EDI file, and stores it in RAM memory. This allows for random access of the EDI segments (using get.. methods); but, because the entire EDI file and its indexes are managed in RAM memory, processing EDI files in dynamic cursor type is slow and cumbersome especially with large EDI files.

When the cursor type is set to ForwardOnly, the EDI file does not get read at the LoadEdi command. It is only opened. Only when the ediSegment.Next method is called does one segment of the EDI file actually gets read into RAM memory. When the Next method is called again, the previous segment is discarded from memory before reading in the next segment. Traversing through an entire EDI file this way is therefore more memory efficient and faster than loading an entire EDI file and creating index of segments just to randomly access the segments later.

Database indexing is far more superior than the components indexing, so it is strongly recommended that one uses the ForwardOnly cursor type to traverse through an EDI file once while storing its data into a database. You can then use the power of the database index to randomly access data in their tables.

An example of an application where dynamic cursor type can be used is an EDI editor because EDI files are normally small, and users would require to randomly move about segments.
More details about Cursor Types


What's the difference between the cursor type: ForwardOnly and ForwardWrite?
ForwardOnly should only be used when reading or translating (inbound) EDI files, while ForwardWrite should only be used when writing or generating (outbound) EDI files.
More on Cursor Types


Does FREDI have a method to send or transmit EDI files to our trading partners?
FREDI can only send EDI files over the Internet using the TCP/IP suite protocols: FTP, SMTP, and HTTP.

' Send EDI file using FTP and SMTP
Set oTransports = oEdiDoc.GetTransports

' Send as FTP
Set oTransport = oTransports.CreateTransport
oTransport.SetFTP ' FTP
oTransport.Address = "www.yourdomain.com"
oTransport.Password = "YourUserID"
oTransport.User = "YourPassword"

' Also send as email
Set oTransport = oTransports.CreateTransport
oTransport.SetSMTP ' SFTP
oTransport.Address = "name@domain.com"
oTransport.DisplayName = "Your name"
oTransport.Message = "Please see EDI file"
oTransport.Subject = "EDI file"

oTransports.Send

Sample VB that sends EDI files over the Internet


Can FREDI convert EDI files into XML files and vice versa?
FREDI can convert EDI files to XML files by simply doing the following steps:

Set oEdiDoc = New Fredi.ediDocument

'Load EDI File
oEdiDoc.LoadEdi sEdiFile

'Save to XML format
oEdiDoc.Save sXmlFile, OutputType_XML

FREDI can also read the same format XML file into an EDI object (see sample program).

Please note that FREDI does not create a corresponding schema (DTD) for the XML file it generates.
Sample VB program that coverts an X12 EDI file to XML


We have a system that generates an NSF file, but now we have to send it as an X12 file. Can FREDI convert an NSF into an X12 file?
No, your best bet would be to create a parallel system (using FREDI) that generates an X12 EDI file by getting its data straight from the database, (and not from the NSF file).

How can I tell if a data element is a composite element, and how would I parse it?
There are a couple of ways to test if a data element is a composite. One method is to use the IsComposite property of the element object. E.g.

If oElement.IsComposite Then 'composite
MsgBox "Composite: " & oElement.ID

Another is to check for the count of the data elements object E.g

Set oElements = oElement.DataElements
If oElements.Count > 1 Then
MsgBox "Composite: " & oElement.ID


The code below is an example of how you can iterate through all data elements including the data elements (components) that are in a composite.

Dim oEdiDoc As Fredi.ediDocument
Dim oSegment As Fredi.ediDataSegment
Dim oElement As Fredi.ediDataElement
Dim oComponent As Fredi.ediDataElement
Dim oComposites As Fredi.ediDataElements
...
'get element from segment
Set oElement = oSegment.DataElement(i)
If oElement.IsComposite Then

'element is a composite
MsgBox "Composite: " & oElement.ID
Set oComposites = oElement.DataElements

'get components from composite element
Set oComponent = oComposites.First
Do While Not oComponent Is Nothing
MsgBox "Composite: " & oElement.ID & " Component: " & oComponent.ID

'get next component
Set oComponent = oComponent.Next
Loop
Else
'element not a composite
MsgBox "Data element: " & oElement.ID
End If

Download complete program


I’m using FREDI to generate an EDI file, but I keep getting an error about it not being able to add a segment at loop instance 2. However, when I change the Cursor Type to ForwardWrite, I don’t get an error and the program seems to work.
A segment in a loop with an erroneous loop instance count is generally the cause of this problem. This problem is quite difficult to find because the problem segment will be one that was created previously and not the segment where the program broke.

The erroneous segment corrupts the hierarchy tree, which would later cause FREDI to fail from building onto it any further, thus generating the error. However, with the Cursor ForwardWrite enabled, the error does not occur because FREDI ignores the loop instances; the segments are committed into the EDI file after every loop, and no hierarchy tree is being built.

Example:

HL\HL
HL\PRV
HL\NM1\NM1
HL\NM1\N3
HL\NM1\N4

HL(2)\HL
HL\SBR <-- problem segment missing loop instance
HL(2)\NM1\NM1
HL(2)\NM1\N3
HL(2)\NM1\N4
HL(2)\NM1(2)\NM1 <-- program stops here


I’ve set my Cursor Type to ForwardOnly so that I’m able to read huge EDI files with minimal memory usage. However, I’m unable to loop back to the top of the EDI document without having to reload the EDI file. I’m afraid reloading the EDI file will hinder performance.
If the cursor type is set to ForwardOnly, the “LoadEdi” method of the ediDocument object does not actually load the whole EDI file. This is because, unlike dynamic mode, the ForwardOnly mode does not keep the EDI file in memory. Therefore, in ForwardOnly mode, the “LoadEdi” method is actually used only to open the EDI file and does not continue to read all the data segments. The data segments are only read when you call methods that actually get the segments e.g. “FirstDataSegment” and “Next”. If the “LoadEdi” method is called again, it basically just re-opens the EDI file, which initializes the pointer to the starting segment of the EDI file without any time delay.


Sample program that iterate thru an EDI file twice in Forward mode


How do I retrieve descriptions of the data elements?
Descriptions of data elements can be obtained by calling the Description method of the ediDataElement object. Below are some examples:

VB Example 1:
-------------
'Return description of all segments and data elements (including
'sub-elements in composite elements) in an EDI file.

While Not oSegment Is Nothing
'Get Segment description
List1.AddItem oSegment.Description

'Get number of elements in segment
nElementCount = oSegment.Count
For nElement = 1 To nElementCount
Set oElement = oSegment.DataElement(nElement)

'Get Element Description
List1.AddItem " " & oElement.Description

'Checks if element is a composite
Set oElements = oElement.DataElements
nCompositeCount = oElements.Count
If nCompositeCount > 1 Then 'Composite element
For nComposite = 1 To nCompositeCount
Set oElement = oElements.DataElement(nComposite)

'Get sub element description
List1.AddItem " " & oElement.Description
Next
End If
Next
Wend


C# Example 2:
-------------
//Return description of third data element
ediDataSegment oSegment = null;
sElementDescription = oSegment.get_DataElement(3).Description


C# Example 3:
------------
//return description of second sub-element of composite data element
//in position one of a segment

ediDataElements oElements = null;
ediDataElement oElement = null;
ediDataElement oCompositeElement = null;
ediDataElements oSubElements = null;

oElements = oSegment.DataElements;
oCompositeElement = oElements.get_DataElement(1);
oSubElements = oCompositeElement.DataElements;
oElement = oSubElements.get_DataElement(2);
sSubElementDescription = oElement.Description;

Download VB sample program that displays segments and elements description


I’m receiving inbound EDI files that are of 80 characters length format. This seems to be a problem because some data segments are longer than 80 characters, and are forced to wrap around to the next line with a linefeed CR/LF. Does FREDI have an option to strip the CR/LF characters so that the EDI file can be read and parsed correctly?
FREDI has an option to ignore the CR/LF characters while the EDI file is being parsed. The syntax is:

oEdiDoc.Option(OptDocument_LineFeed) = 1

However, we strongly recommend that trading partners sending EDI files with this format should be notified of this error. (Companies receiving EDI files should not have the liability of correcting EDI files from their trading partners.)


Sample program that translates an EDI file with 80 char format


Is FREDI thread safe?
Yes.

([User contribution] For Delphi users, you need to explicitly call CoInitialize before using FREDI, and CoUninitialize after using FREDI.)

The eFilemanager has detected errors in my EDI file, but I still find it difficult to locate the problem segments.
To quickly find a problem segment in an EDI file with the eFilemanager, you can click on the word "WARNING" of the warning message, which would then highlight the segment in the hierarchy tree that contains the error.

I have to generate multiple EDI files (over 1000 files) of one Transaction Set (message). So I’m wondering if there is an effective way of generating multiple EDI files without having to reload the SEF file each time I create one EDI file. (topic: ediDocument.New)
If you have to generate multiple EDI files of the same Transaction Set, then it would be more efficient to reuse the ediDocument object, and not destroy it to avoid having to recreate it and reload the SEF file again. The ediDocument object can be reused by using the “New” method to clear all its setting except for the schema.

Example:

‘Create ediDocument object
Set oEdiDoc = New Fredi.ediDocument

‘Load SEF file
oEdiDoc.LoadSchema sSefFile, 0

‘Start Loop
While …..

‘Clear oEdiDoc object but schema information
oEdiDoc.New

‘Create oEdiDoc segments and elements
….

‘Save oEdiDoc to EDI file
oEdiDoc.Save sEdiFile

‘End Loop
Wend

Sample VB program that generates multiple EDI files.


Can I process an EDI file with a SEF file of a later version? For example can I use SEF file 850_4030.SEF to process an 850 version 4010?
We do not recommend it. SEF versions are not backward compatible, so later versions of SEF files will not correctly process an EDI file with a different version.

How do I generate multiple interchanges in a document?
Multiple interchanges in one document (file) can be generated by simply calling the “CreateInterchange” method of the same ediDocument object as many times you would like to create interchanges. For example, you would do the following:

'Create FIRST Interchange
set oInterchange = oEdiDoc.CreateInterchange("X","004010")

'Create Functional Group
set oGroup = oInterchange.CreateGroup("004010")

'Create Transactionset
set oTransactionset = oGroup.CreateTransactionset("850")
set oSegment = oTransactionset.CreateDataSegment("ST")
oSegment.DataElementValue("143") = "850"
oSegment.DataElementValue("329") = "0001"


'Create SECOND Interchange
set oInterchange = oEdiDoc.CreateInterchange("X","004010")

'Create Functional Group
set oGroup = oInterchange.CreateGroup("004010")

etc..

'Save EDI document
oEdiDoc.Save sEdiFile

Download VB sample program that generates multiple interchanges


I have an EDI 820 file (Payment Order/Remittance Advice) that has version 3050 (00305) in its ISA segment, but has version 4010 (004010) in its GS segment. What SEF files would I need to load into FREDI to acknowledge this EDI file correctly?
You would need to load a 3050 version SEF file for parsing the ISA segment, the 820 version 4010 SEF file (820_4010.SEF) for parsing the GS segment (and all other segments enclosed in the group), and a 997 version 4010 SEF file (997_4010.SEF) for creating the 997 Functional Acknowledgment file.
Download VB sample programs that acknowledges an EDI file with different ISA/GS version


When I load all my SEF files that I need for processing the EDI documents that I receive from my trading partners. I noticed that during the "LoadEdi" method, the first EDI file seems to always take much longer to process than all the others, even though the file size is the same. Why is this? (Subject: LoadSchema, ImportSchema)
The time difference is caused because when using the "LoadSchema" method, the SEF files are not actually loaded at the "LoadSchema" command line, but during the "LoadEdi" command line. (This makes it seem that the first EDI file is slow to load.) But, once the SEF files are loaded, the next time the "LoadEdi" method gets called, then only the EDI file is loaded (and not the SEF files, since they are already loaded), therefore the subsequent "LoadEdi" calls seem faster to load an EDI file.

You can however use the "Import Schema" method, which uses the same syntax as the "LoadSchema" method. The only difference is that the SEF files will get imported (loaded) at the "ImportSchema" method command line, and not during the "LoadEdi" method.

Sample VB program that uses the ImportSchema method


I have a code string of 30 characters that is padded with trailing blank spaces that my trading partner requires I include to make the code string to be always 30 characters, but FREDI automatically strips the trailing spaces off. Is there an option to stop FREDI from automatically truncating the trailing blank spaces?
There is no option property to stop FREDI from truncating the trailing spaces. However, if you edit the SEF file so that the minimum length of the data element would be 30 (or the required minimum length), then FREDI will not truncate the code string since the minimum length is met.

To edit a data element of a SEF file with the SEF Manager, simply find the node of the data element in the hierarchy, select it, then right click, and then select “Change Element”.


How do I generate a segment with a composite element e.g. C040?
To assign a value to a composite element, you would need to specify the subelement parameter (which would be the second parameter in the DatElementValue method). For example, to generate a REF segment, which has the fourth data element as a composite element (e.g. C040), you would do the following:

Set oSegment = oTransactionSet.CreateDataSegment(REF)
oSegment.DatElementValue(1) = …
oSegment.DatElementValue(2) = …
oSegment.DatElementValue(3) = …
oSegment.DatElementValue(4,1) = …
oSegment.DatElementValue(4,2) = …
oSegment.DatElementValue(4,3) = …
oSegment.DatElementValue(4,4) = …
etc..



How do I read multiple EDI files without having to load the same SEF files for each of the EDI files?
If you don’t destroy the ediDocument object that the SEF files were loaded into, you can reuse it for the next EDI file that you want to read. For example, your algorithm would look like:

‘Instantiate document object
Set oEdiDoc = New Fredi.ediDocument

‘Load all SEF files
oEdiDoc.LoadSchema sSefFile
oEdiDoc.LoadSchema sSefFile2
oEdiDoc.LoadSchema sSefFile3
'etc...

‘Loop to process all EDI files
While Not AllDocumentsProcessed
‘Load EDI file
oEdiDoc.LoadEdi sEdifile

‘Process EDI File
While not oSegment is Nothing

Set oSegment = oSegment.Next
Wend
Wend

Sample VB program that processes 300 EDI files


My trading partner requires that the fourth data element of the GS segment (GS04), which holds the date value, to be 6 characters long (YYMMDD); but FREDI is generating the GS04 data element to be 8 characters (padded with two spaces). How do I truncate those two spaces? I’m using SEF file 832_4010.
This problem occurs because FREDI enforces the minimum and maximum length of data elements. And the length of the GS04 data element in an 832_4010 SEF file is 8 characters long (YYYYMMDD). However, the SEF file can be edited using the SEF Manager to change the data element length, by first finding the GS segment under the section “Data Segments Directory (.SEGS)”, then expand the segment to find the element, and then right-click on the element to “Change Element” maximum length to 6, and minimum length to 6.

How do I change the values in the EDI 997 Functional Acknowledgment file that FREDI automatically generates?
You can change the values in the 997 file by making the changes in the Acknowledgment object before calling the save method. To change a value in a data element, you would have to first get the segment of the acknowledgment object, and then assign the value to its data element. For example, to change the value in ISA 13 to “0000000002”, you would do the following steps:

Set oSegment = oAck.GetFirst997DataSegment
Set oSegment = oSegment.GetDataSegmentByPos("ISA\ISA")
oSegment.DataElementValue(13) = “0000000002”



Our company receives EDI files that are over 5MB, so I have to change the Cursor Type to “ForwardOnly” when translating these large size EDI files. However, if I change the Cursor Type to ForwardOnly, FREDI creates a blank (empty) functional acknowledgement (997) EDI file when I enable FREDI’s acknowledgment. Is it possible to have FREDI automatically generate the ‘997’ file with ForwardOnly Cursor Type?
When the cursor type is set to ForwardOnly, FREDI does not load the entire EDI file at the ‘LoadEdi’ command line. The data segments of the EDI file are only loaded when the 'Next' method is called. So for FREDI to validate the EDI file and to create a correct Functional Acknowledgment(997), one must iterate through all the segments of the EDI file; otherwise a blank (empty) acknowledgment will get generated.

Example

Set oEdiDoc = New Fredi.ediDocument
oEdiDoc.CursorType = Cursor_ForwardOnly

oEdiDoc.LoadSchema sSefFile

Set oAck = oEdiDoc.GetAcknowledgment
oAck.EnableFunctionalAcknowledgment = True

oEdiDoc.LoadEdi sEdiFile

‘Iterate through all the segments
Set oSegment = oEdiDoc.FirstDataSegment
While Not oSegment Is Nothing
Set oSegment = oSegment.Next
Wend

oAck.Save sAckfile

sample Acknowledgment program


Is there a setting in FREDI so that the Functional Acknowledgment (997), it automatically creates, does not display the AK2 and AK5 segments when there are no errors found in the Transaction Set?
Yes. You can set the ‘OptAcknowledgment_ShowReportingLevel “ in the ‘Option’ property of the ediAcknowledgment object to 0 (zero) so that FREDI will only report rejected Transaction Sets.

Example:
:
Set oAck = oEdiDoc.GetAcknowledgment
oAck.Option(OptAcknowledgment_ShowReportingLevel) = 0 'Report only rejected transaction sets
oAck.EnableFuncationalAcknowledgment = True
oEdiDoc.LoadEdi sEdiFile
oAck.Save sAckFile


For more details, please refer to the Help Documentation under “Framework EDI”, ‘Methods and Properties”, “ediAcknowledgment.Option”.


I’m using FREDI to parse an 850 4030 EDI file, but I find that it’s unable to read data elements that have the character “U”.
This is a common problem when processing EDI files with Interchange Control Version Number (in ISA12) of 00402 and later, because of the introduction of the "repetition separator" character (I65) defined in the eleventh data element of the ISA segment. In previous versions (00401 and earlier), the eleventh data element was I10, which defined the "Interchange Control Standards Identifier" that always had a value "U". (Versions earlier than 00402 did not support repeating elements.)

In FREDI, the following can cause the problem of not correctly parsing EDI files of version 00402 and later:

i.) An incorrect ISA segment by having a 00402 version or later (defined in the twelfth data element I11), but having a "U" in the eleventh data element. The character "U" in this position would be translated to mean that all "U" characters in the EDI file are "repetition separator" characters.

Or

ii.) When an EDI file has a version earlier than 00402 in the ISA segment, but has a GS segment version of 004020 and later. For example:

ISA*00* *00* *ZZ*RECEIVERISA *14*0073268795005 *011013*1443*U*00401*000000001*0*T*>~
GS*PO*SENDERGS*007326879*20020226*1534*1*X*004030~

The above would be incorrectly parsed by FREDI if only a SEF file of version 4030 is used because FREDI will use the 4030 SEF file to also parse the ISA segment; and therefore it would take all “U” characters in the EDI file to be a repeating element separator.

In cases, where the EDI file has different versions in the ISA and GS segment, SEF files for both versions must be provided. E.g.

oEdiDoc.LoadSchema 850_4010, 0
oEdiDoc.LoadSchema 850_4030, 0
oEdiDoc.LoadEdi sEdiFile


For all other cases, below are the solutions:
1. The best solution is to inform your trading partner (that sent you the EDI file) that they are incorrectly using the ISA11 data element.

2. Or, you can change data element ISA11 to something else (usually a colon ":", if it is not already being used as a composite terminator), but this is not recommended because one should not be editing their trading partner's EDI file.

3. Or, you can edit the SEF file with a text editor and change the I65 data element to I10. Example:

From:
ISA=[I01,M][I02,M][I03,M][I04,M][I05,M][I06,M][I05,M][I07,M][I08,M][I09,M][I65,M][I11,M][I12,M][I13,M][I14,M][I15,M]

To:
ISA=[I01,M][I02,M][I03,M][I04,M][I05,M][I06,M][I05,M][I07,M][I08,M][I09,M][I10,M][I11,M][I12,M][I13,M][I14,M][I15,M]

(The I10 data element must be present in the Data Elements Directory (.ELMS) with property I10=ID,1,1)

But, this improvisation is not recommended because it's an improper use of the standard, and also if your trading partner decides to correct his EDI file and start using repeating separators, then your program might break.






After I installed the FREDI Runtime License, I find that the reference to the “EDIdEv Framework EDI” is missing from my source code. Thus, I am unable to compile my program. Why does this happen?
When the FREDI Runtime License is installed, it removes all other FREDI Licenses in the computer including the Professional or Enterprise License that has the type library file, which allows for programming languages to reference to it. Without the FREDI type library file, you will not be able to compile your program. The FREDI Runtime cannot be used for development, and should only be used to deploy with your compiled program.

Why doesn’t my Access program work with the FREDI Runtime License, but works only with the FREDI Professional License?
The FREDI Runtime License will not work with an Access program (with an .mdb extension) unless it is compiled (.mde extension). FREDI Runtime Licenses can only be deployed with compiled programs.

Which errors do FREDI include in the Functional Acknowledgment (997) it creates automatically? I’ve noticed some errors that FREDI finds during validation (ediWarnings) are not included in the 997 file.
FREDI includes the following pre-defined errors in the 997 implementation guideline when acknowledging an EDI file.

Data Segment Error Code (AK304)
1 – Unrecognized segment ID
2 – Unexpected segment
3 – Mandatory segment missing
4 – Loops occur over maximum times
5 – Segment exceeds maximum use
6 – Segment not in defined transaction set
7 – Segment not in proper sequence
8 – Segment has data element errors


Data Element Error Code (AK403)
1 – Mandatory data element missing
2 – Conditional required data element missing
3 – Too many data elements
4 – Data element too short
5 – Data element too long
6- Invalid character in data element
7 – Invalid code value
8 – Invalid date
9 – Invalid time
10 – Exclusion condition violated



Transaction Set Acknowledgment Code (AK501)
A – Accepted
E – Accepted But Errors Were Noted
R – Rejected


Transaction Set Error Code (AK502-06)
1 – Transaction Set Not Supported
2 – Transaction Set Trailer Missing
3 – Transaction Set Control Number in Header and Trailer Do Not Match
4 - Number of Included Segments Does Not Match Actual Count
5 – One or More Segments in Error
6 – Missing or Invalid Transaction Set Identifier
7 – Missing or Invalid Transaction Set Control Number



Functional Acknowledgment Code (AK901)
A – Accepted
E – Accepted But Errors Were Noted
R – Rejected


Functional Acknowledgment Error Code (AK905-09)
1 – Functional Group Not Supported
2 – Functional Group Version Not Supported
3 – Functional Group Trailer Missing
4 – Group Control Number in the Functional Group Header and Trailer Do Not Agree
5 – Number of Included Transaction Sets Does Not Match Actual Count
6 – Group Control Number Violates Syntax


Other errors that you want to include into the 997 file can be mapped to an appropriate error code by using the “MapDataElementLevelError” or “MapDataSegmentLevelError” or “MapGroupLevelError” method of the ediAcknowledgment object.

For more details, please refer to the Help Documentation under “Framework EDI Object Module”, “Methods and Properties”

Sample Ack program with error level mapping


I’m using Visual Studios Deployment Wizard to create an installer for my application with the FREDI components, which creates an installation package successfully. Also, the installation package seems to run successfully with no errors, but when I try to run my application, an error occurs saying that FREDI has expired. I’m using FREDI that I purchased to build the installation package, so why do I get a date expiration message?
This error occurs because the “Edidev_Dictionary.edb” file was not installed in the same directory as the other FREDI distributable files. All distributable files of FREDI must reside in the same folder. To correct this error, you must edit the SETUP.LST created by Visual Studios Deployment Wizard so that the “Edidev_Dictionary.edb” file gets copied into the same folder as the other FREDI files.

Please refer to the Help Documentation included in Framework EDI program group for more details. The topic is under “Contents” tab, then select “Getting Started”, then “Distributable Files”.


How can I ascertain what SEF file is required to process a particular EDI file?
By checking data element GS08 and data element ST01 of an X12 EDI file, you can ascertain the SEF file required to process it. For example

Example 1. An EDI file with the following GS and ST segments

GS*PO*SENDERGS*007326879*20011110*1759*000001*X*004010~
ST*850*000000001~

would require an 850 4010 SEF file, which would have the following lines

.INI
…,,004 010,X,…,…
.SETS
850=^…


Example 2. An EDI file with the following GS and ST segments

GS*HC*SENDERGS*007326879*20011110*1759*000001*X*004010X098A1~
ST*837*000000001~

would require an 837 4010 X098A1 SEF file, which would have the following lines

.INI
…,,004 010 X098A1,X,…,…
.SETS
837=^…



In UN/EDIFACT, the FREDI component checks the UNB and UNH segment to ascertain the corresponding SEF file.

Example 3. An EDI file with the following UNB and UNH segments

UNB+UNOA:1+SENDER:ZEW+RECEIVER:ZEW+030407:1204+2451840'
UNH+00001+ORDERS:D:96A:UN '

Would require an ORDERS D 96A SEF file, which would have the following lines

.INI
…,,ORDERS D 96A,X,…,…
.SETS
ORDERS=^…



I'm working with a huge EDI file, so I've set the cursor type to forward only. However, I can't save the EDI file when the cursor type is set to Forward only. What can I do to allow me to read and write huge EDI file?
Unfortunately, there is no easy way to read (load) and then write (save) an EDI file with Forward Cursor types. You would have to manage this function in your program. One method would be to create two ediDocument objects: one for reading; the other for writing. You would load the EDI file into one ediDocument object using the ForwardOnly cursor type; and then map the values into the other ediDocument object with the ForwardWrite cursor type to save it into a different file name. See sample program
Sample VB6 sample program that Reads/Writes an X12 EDI file using Forward Cursor Types


Why does the LoadEdi method take so long, when I’m only loading an EDI file of 1KB? (LoadSchema, ImportSchema, SEF)
If you are using the LoadSchema method to load SEF files, then the initial call of the LoadEdi method will take quite long to process because it is actually loading the SEF files as well as the EDI file at this time. However, subsequent calls to the LoadEdi method does not load the SEF files, since they are already loaded, and so will be faster.

You can use the ImportSchema method to load the SEF files at the command, so that it does not happen during the initial call of the LoadEdi method. But, this does not actually improve the overall time to process the EDI file since the time to process the SEF file would only be moved up to the ImportSchema method (from the LoadEdi method). However, if you have multiple EDI files, performance can be improved by not calling the LoadSchema or ImportSchema again for every EDI file (since the SEF files are already loaded), but just call the LoadEdi method.

Another cause for the delay, could be, that the EDI file you’re loading does not match any of the SEF files you’ve loaded. If FREDI does not find the correct match (of Transaction Set No and Version), then it will search for the correct schematic in its internal Standard Reference Library (SRL). This should be avoided because the SRL uses a lot or memory, and is cumbersome and slows down overall performance. To disable FREDI from using its internal Standard Reference Library do the following.

oSchemas.EnableStandardReference = False

For example:

Set oEdiDoc = New Fredi.ediDocument
Set oSchemas = oEdiDoc.GetSchemas
oSchemas.EnableStandardReference = False

oEdiDoc.ImportSchema sSefFile, 0

'..start loop to read edi file

oEdiDoc.LoadEdi sEdifile

'...end loop

I’m having difficulty deploying my program (written in MS Access) with FREDI runtime components.
FREDI runtime components contain only the distributable files of FREDI, which do not include files for development. Therefore, if you deploy your program so that users have access to your source code (e.g. mdb, vbp), then the FREDI runtime will not work with it because your program development environment would require FREDI type library files, which are not distributable. (It is not part of the distributable files.)

To successfully deploy your program with the FREDI runtime, you would have to first build, or compile your program with a development version of FREDI (e.g. Professional) to create an EXE file, or MDE (Access). This will include the FREDI libraries into your program EXE or MDE file, so that the FREDI Runtime is all that’s needed for your program to run.

If you want to deploy your program with its source code, then it would have to be deployed with the development license of FREDI (Professional, Enterprise or Universal).

Can Framework EDI (FREDI) generate the control numbers (in the ISA and GS segment) automatically? Are there any rules to generating the control numbers?
FREDI does not generate any of the control numbers automatically for the ediDocument object, so your program has to generate them. However, FREDI does check to see that there are no duplicate Transaction Set (or Message) Control Numbers within a Functional Group; and that there are no duplicate Functional Group Control Numbers within an Interchange; and that there are no duplicate Interchange Control Numbers in an EDI file.

In the Functional Acknowledgment (997) file, the control numbers that are generated by FREDI, can be controlled by using the "StartControlNumber" values of the Property method of the ediAcknowledgment object e.g.

Set oAck = oEdiDoc.GetAcknowledgment
oAck.Property(PropertyAck_StartGroupControlNum) = nGroupControlNo
oAck.Property(PropertyAck_StartInterchangeControlNum) = nInterchangeControlNo
oAck.Property(PropertyAck_StartTransactionSetControlNum) = nTsControlNo


Interchange Control Numbers must be unique for all interchanges (ISA) that are sent. We also recommend that the Functional Group Number be unique as well because the Functional Acknowledgment (997) file refers to the Functional Group Number (and not the Interchange Control Number) when acknowledging an EDI file.


What are an Interchange, a Functional Group and a Transaction Set?
The Interchange is like the envelope for the electronic message. It contains all the Transaction Sets that are enclosed between its header segment (ISA) and trailer segment (IEA).

The Functional Group categorizes the Transaction Sets in the Interchange by their departments or by their functions e.g. Invoices would be grouped separately from Purchase Orders. The Transaction Sets are grouped together into their Functional Group by enclosing them between the group header segment (GS) and the group trailer segment (GE).

The Transaction Set is the message itself. The header segment of a Transaction Set (ST) marks the beginning of the message; while the trailer segment (SE) marks the end of the message.


What is a loop? And what is a loop instance? (Other topics: qualifier, entity identifier)
A loop is a group of data segments that are inter-dependant of each other, which together constitute a block of information. An example of a loop is the N1 loop, which holds a company’s address information. The loop consists of the N1, N2, N3, and N4 segments; where the N1 segment holds the company name, the N2 segment holds other additional names, N3 holds the street address, and the N4 segment holds the city, state and zip information.

A loop or the same group of segments can be used repeatedly to depict other information. For example, the same N1 loop can be used to hold a “Ship-To” address, and “Remit-To” address differentiated by the entity identifier of the loop. Each use of the loop is called an instance of the loop.

FREDI examples:
'CREATES THE N1 SEGMENT IN LOOP N1 (SHIP TO)
Set oSegment = oTransactionset.CreateDataSegment("N1\N1")
oSegment.DataElementValue(1) = "ST"
oSegment.DataElementValue(2) = txtShipToName.Text
oSegment.DataElementValue(3) = "9"
oSegment.DataElementValue(4) = txtShipToDUNS.Text

'CREATES THE N3 SEGMENT IN LOOP N1 (SHIP TO)
Set oSegment = oTransactionset.CreateDataSegment("N1\N3")
oSegment.DataElementValue(1) = txtShipToAddress.Text

'CREATES THE N4 SEGMENT IN LOOP N1 (SHIP TO)
Set oSegment = oTransactionset.CreateDataSegment("N1\N4")
oSegment.DataElementValue(1) = txtShipToCity.Text
oSegment.DataElementValue(2) = txtShipToState.Text
oSegment.DataElementValue(3) = txtShipToZip.Text

'CREATES THE N1 SEGMENT IN LOOP N1 (BILL TO)
Set oSegment = oTransactionset.CreateDataSegment("N1(2)\N1")
oSegment.DataElementValue(1) = "BT"
oSegment.DataElementValue(2) = txtBillToName.Text
oSegment.DataElementValue(3) = "9"
oSegment.DataElementValue(4) = txtBillToDUNS.Text

'CREATES THE N3 SEGMENT IN LOOP N1 (BILL TO)
Set oSegment = oTransactionset.CreateDataSegment("N1(2)\N3")
oSegment.DataElementValue(1) = txtBillToAddress.Text

'CREATES THE N4 SEGMENT IN LOOP N1 (BILL TO)
Set oSegment = oTransactionset.CreateDataSegment("N1(2)\N4")
oSegment.DataElementValue(1) = txtBillToCity.Text
oSegment.DataElementValue(2) = txtBillToState.Text
oSegment.DataElementValue(3) = txtBillToZip.Text



What is a qualifier? (Other topics: entity identifier, repeat maximum, instance)
A qualifier is a code value of a data element that describes the value of another data element in the same segment. For example, the DTP segment is a date segment, which can hold dates for a variety of events. Therefore a qualifier is needed to describe specific dates like when was the date for the “Initial Treatment”, or “Last Visit”. In this example, their qualifiers would be "454" and "304" respectively.

Set oSegment = oTransactionset.CreateDataSegment("DTP")
oSegment.DataElementValue(1) = “454” ‘Initial treatment
oSegment.DataElementValue(2) = “D8”
oSegment.DataElementValue(2) = “20010327”

Set oSegment = oTransactionset.CreateDataSegment("DTP(2)")
oSegment.DataElementValue(1) = “304” ‘Last visit
oSegment.DataElementValue(2) = “D8”
oSegment.DataElementValue(2) = “20031204”

This is also an example where the same DTP segment is used in two different instances.

I'm a programmer consultant who is developing an EDI application for my client. Which FREDI license would I need? (Licensing)
You would at least need the FREDI Professional License for EDI application development. If you do a lot of EDI programming consulting, then it may be cost-effective for you to own the Professional License, and buy a FREDI Runtime License for each EDI application (you've created using FREDI) that you deploy to your clients. If you don't do much EDI programming consulting, then it may be more cost-effective for your clients to purchase and own the Professional License, and have you develop the EDI solution for them.

I'm creating an EDI solution on a server. What FREDI license would I need? (Licensing)
You would at least need the FREDI Professional License to develop the EDI solution. Depending on the EDI solution you've created for the server, it would have to be deployed with either the standard Runtime License, or the Server Runtime License.

I have a team of developers, and plan to create an EDI solution to install on several computers in the company, as well as on a couple of servers in our other offices. What FREDI license would I need? (Licensing)
It would be more cost-effective to purchase the Enterprise License because it is a site license, which allows you to install FREDI on all computers that are physically located at the site.

It also includes 2 server runtime licenses to allow you to deploy the FREDI server runtime components to 2 other servers that are physically located outside the company site.

I’m deploying a package that has many programs (multiple exe files). How many FREDI Runtime Licenses do I need to purchase? (Licensing)
If your package (that has multiple programs) has one installation per computer, then you would only need to purchase 1 FREDI Runtime per deployed package.

I’m installing my application (that’s using FREDI components) on a server that has about 200 workstations networked to it. How many FREDI Runtime Licenses would I need? (Licensing)
You would only need 1 Runtime License or Server Runtime License to install into 1 server. Depending on your EDI solution the runtime license can be installed on either a server or workstation.

However, if you were to install your application (using the FREDI components) on all 200 workstations, then you would have to buy 200 FREDI Runtime Licenses.

The evaluation copy of FREDI that I’ve downloaded has expired. Is there a way to extend the expiration date so that I can continue with my evaluation? (date expiration)
Yes, you can simply download the evaluation copy of FREDI again from our website at www.edidev.com, and install it again by selecting the “Re-install” option.

How do I include the UNA segment in a UN/EDIFACT EDI file?
The UNA segment can be included in the UN/EDIFACT file by setting the OptDocument_ServiceSegment option to 1, after the terminators have been set.

For example:

oEdiDoc.SegmentTerminator = "'" & vbCrLf
oEdiDoc.ElementTerminator = "+"
oEdiDoc.CompositeTerminator = ":"
oEdiDoc.ReleaseIndicator = "?"

'Creates UNA segment
oEdiDoc.Option(OptDocument_ServiceSegment) = 1

Sample VB program that generates a UN/EDIFACT file with a UNA segment


FREDI does not seem to support the character "-" in data element 116 "Postal Code" of segment "N4". How can I make this data element accept dashes for 10 digit zip codes?
Data element 116 does not accept dashes because it is of type "ID" or identifier. Only letter or numeric digits are accepted for data type "ID". To save 10 digit zip codes into an EDI file, you would have to strip off the dash "-"; you can then later add back the dash when you read or translate the EDI file.

If you’re trading partner's guideline allows dashes for this data element, then you would have to modify the SEF file so that the data element type for the data element is changed from "ID" to "AN" (alpha numeric.)

To change the data element type with our SEF Manager, goto "Data Elements Directory (.ELMS)", find the data element, then right-click on it to edit.


Example Ack program


How do I make FREDI support additional codes that our trading partners have included in some of their data elements?
Additional codes for data elements can be added into the "Codes Directory (.CODES)" section of the SEF file by using our SEF Manager utility.

To add codes into the SEF file using our SEF Manager, goto "Codes Directory (.CODES)" then find the data element, and then expand it. Right click on the "Partition" node to add codes.


I'm using FREDI to acknowledge EDI files as large as 4MB, but it seems slow and would sometimes fail. How can I improve the performance?
You can significantly improve the performance of FREDI by setting the cursor type to "ForwardOnly" before loading the EDI file. This stops FREDI from loading the complete EDI file into RAM memory, and therefore stops it from exhausting memory resource and bogging it down.

Also, when changing the cursor type to "ForwardOnly", the "Document Buffer" property should also be increased so that hard drive access does not become a bottleneck.

'Sets cursor type to ForwardOnly.
'This stops FREDI from loading the complete EDI file into memory.
oEdiDoc.CursorType = Cursor_ForwardOnly

'Increase the buffer option so that accessing the
'hard drive does not become a bottleneck.
oEdiDoc.Property(Property_DocumentBufferIO) = 200

'Load SEF files for 997 and 850
oEdiDoc.LoadSchema sSefFile, 0
oEdiDoc.LoadSchema sSef997, 0

'Enable acknowledgement
Set oAck = oEdiDoc.GetAcknowledgment
oAck.EnableFunctionalAcknowledgment = True

'Loads EDI file.
'When Cursor Type is set to Forward Only, this command does not load the
'complete EDI file.
oEdiDoc.LoadEdi sEdiFile

'Because the Forward Cursor Type does not load the complete EDI file
'into memory, we have to iterate through each segment so that they
'be analyzed.
Set oSegment = oEdiDoc.FirstDataSegment
Do While Not oSegment Is Nothing
Set oSegment = oSegment.Next
Loop

'Save acknowledgment file.
oAck.Save sAckfile

VB sample program that acknowledges EDI files using the ForwardOnly cursor type


I'm trying to generate a data segment that repeats, but I find that only the last data segment is saved. For example, I'm trying to generate the following DTM segments... DTM*004*20041010 DTM*002*20041110 ...but only the last DTM segment is saved in the EDI file.
This problem is caused because the instance of the segment was not included in the hierarchy tree syntax of FREDI. For example the syntax to create the above segments should be:

Set oSegment = oTransactionset.CreateDataSegment("DTM")
oSegment.DataElementValue(1) = "004"
oSegment.DataElementValue(2) = "20041010"

Set oSegment = oTransactionset.CreateDataSegment("DTM(2)")
oSegment.DataElementValue(1) = "002"
oSegment.DataElementValue(2) = "20041110"

Note the 2 in parentheses included in the DTM denote the second instance of the DTM segment. Without this instance, the second DTM will overwrite the first DTM.

Another solution to this problem is simply to set the Cursor Type to ForwardWrite. For example:

:
Set oEdiDoc = New Fredi.ediDocument
oEdidoc.CursorType = Cursor_ForwardWrite
:
Set oSegment = oTransactionset.CreateDataSegment("DTM")
oSegment.DataElementValue(1) = "004"
oSegment.DataElementValue(2) = "20041010"

Set oSegment = oTransactionset.CreateDataSegment("DTM")
oSegment.DataElementValue(1) = "002"
oSegment.DataElementValue(2) = "20041110"

With the ForwardWrite cursor type, the instances are not needed because the segments are committed to the EDI file after each data segment repeat or loop.


What's the purpose of the Transact SQL Script created by the SM Plug-In.
The Transact SQL Script generated by the SEF Manager Plug-In is to help programmers create tables (and their relationships) in correlation to the schema of the SEF file.

However, just like how you would have to translate an EDI file, the database schema would have to be translated before it can actually be useful, which would mean renaming table names, field names or deleting unnecessary fields.

For example, in an X12 837 schema, there is a 1000A loop (NM1), which is to hold the “Submitter” information. The transact SQL table name correlated with this loop, which gets generated by the SM Plug-In is

“Transaction_Set_837_Area_1_Loop_Nm11000A”.

But to make this table more useful, friendly and comprehendible, it should be renamed to “Submitter Info” (or something like it). Then likewise, you would go through its fields and rename them appropriately, or delete the unwanted fields. For example you may want to delete the following fields:

[NM1020_01_Entity_Identifier_Code]
[NM1020_02_Entity_Type_Qualifier]

and rename the following fields from

[NM1020_03_Name_Last_Or_Organization_Name]
[NM1020_04_Name_First]
[NM1020_05_Name_Middle]

to

[Submitter Lastname]
[Submitter Firstname]
[Submitter MiddleName]


Some programmers who like to do things from scratch may not find the transact SQL script created by the SM Plug-In to be useful; however some will find it useful because most of the table structures, and table relationships are already created for them by the SM Plug-In.

It is not our intention to have programmers use the Transact SQL script “as is” without any modification.



I just installed FREDI, but it seems to run very slowly. What are the minimum system requirements to run FREDI, and how can I improve performance.
The recommended system requirements for Framework EDI (FREDI) are:
256MB RAM
1GHz CPU speed
1GB available disk space

There are a couple of reasons that can cause FREDI’s performance to degrade. One that is commonly made is the mistake of using an incorrect SEF file to process an EDI file because this would cause FREDI to use and search though its internal Standard Reference Library (SRL) to find a possible schema for the EDI file. This scenario should be avoided because the SRL uses a lot of memory, and is cumbersome.

Another reason for the performance degradation could be the size of the EDI file. When dealing with EDI files greater than 500KB, we recommend changing the default setting of the Cursor Type from “Dynamic” to “Forward”. This stops FREDI from storing the whole EDI information into RAM memory, and avoids the computer from running out of memory when a huge EDI file is being processed. Also, please note that the eFileManager utility was designed for viewing small EDI files only.


I’m using FREDI to read a large (huge) 50MB EDI file, but it seems to bog down and fail. Is there a limit to the size of an EDI file that FREDI can read?
The default cursor type setting of FREDI is “Dynamic”, which loads the complete EDI file into RAM memory. Although this may give better flexibility in managing an EDI file, it consumes a lot of computer resources especially when the EDI file is huge causing the process to slow down or fail when RAM memory becomes depleted. So an option to improve FREDI’s performance, and so that it can read huge EDI files, is to change the Cursor Type setting to ForwardOnly. This setting will cause FREDI to keep in memory only the segments that it is processing, and thus not use up all the RAM memory.

Example:

Set oEdiDoc = New Fredi.ediDocument

oEdiDoc.CursorType = Cursor_ForwardOnly

oEdiDoc.LoadSchema sPath & sSefFile, 0
oEdiDoc.LoadEdi sPath & sEdiFile
Set oSegment = oEdiDoc.FirstDataSegment
While Not oSegment Is Nothing

Set oSegment = oSegment.Next
Wend


Can I programmatically determine the transaction set number (or message id) and version of an EDI file before loading the SEF file? I need to process multiple EDI files with variations of SEF files.
FREDI requires a schema (SEF file) to parse an EDI file correctly. So without a SEF file being loaded first into FREDI, it can't determine the transaction set number and version of the EDI file, which brings about the situation of the “chicken and the egg” if you have a variation of EDI files to process - how can you load the correct SEF file to determine which SEF file to use in the first place? This problem can be resolved by loading into FREDI all the SEF files that are needed to process all the variations of EDI files you will be supporting. So that when an EDI file is loaded, FREDI will automatically select the correct SEF file (from among the SEF files loaded) to process the EDI file.

Example,
Set oSchemas = oEdiDoc.GetSchemas
oEdiDoc.LoadSchema ("850_4010.SEF")
oEdiDoc.LoadSchema ("850_4030.SEF")
oEdiDoc.LoadSchema ("810_4010.SEF")
‘etc…

oSchemas.Import
oEdiDoc.LoadEdi sEdiFile


The downside with the above logic is the delay caused by initially loading all the SEF files beforehand. In a desktop application, it may not be too much of an issue since you can design your program to load all the SEF files only one time and keep the object in memory for every EDI you want to process. But, in an ASP application, loading all the SEF files per connection is unavoidable. This problem can be resolved by the SetOnDemand option (available only in FREDI 5.1 and later) so that only the correct SEF file is loaded when an EDI file requires it. For example:

Set oSchemas = oEdiDoc.GetSchemas
oSchemas.Option(OptSchemas_SetOnDemand) = 1

oEdiDoc.LoadSchema ("850_4010.SEF")
oEdiDoc.LoadSchema ("850_4030.SEF")
oEdiDoc.LoadSchema ("810_4010.SEF")
‘etc…

oEdiDoc.LoadEdi sEdiFile


What is EDI?
EDI or Electronic Data Interchange is the electronic exchange of data in a standard format between computers without any human intermediary. The two widely used standards are X12 (commonly used in U.S.A and Canada), and UN/EDIFACT (commonly used in Europe and the rest of the world).

So a successful implementation of EDI must have the following:

1. Data must be exchanged electronically. This means that EDI should not involve any paper.
2. Data exchanged must follow a standard format. This means any other electronic forms of data like spreadsheet; database or document that does not have a governing body to specify a standard is not EDI.
3. Data exchanged must be created from one computer, and read by another computer without any human intervention. This means that data exchanged should not have to be read or entered by a human during the process of generating and translating the EDI file.


What does the Outbound and Inbound terminology in EDI mean?
Two well-defined processes in EDI are the Outbound, and Inbound process. The Outbound process is the creation of EDI files from an existing system, and sending them to a trading partner. The Inbound process is the receiving of EDI files from a trading partner and translating them into an existing system.


Are EDI messages saved as regular computer files? And how should I name EDI files? Do they require a special file extension?
The normal practice is to save EDI messages into regular computer files before sending it. But it’s also possible to save the complete EDI message into a blob field of a database. There are no rules in how EDI messages should be saved, nor any naming standard conventions for EDI files. However, just keep in mind that you may have to refer back to these EDI files; so you should have an organized system of storing and naming them so that they do not get overwritten, or lost; and so that they can also be easily found.

There are no special file extensions for EDI files, but some common ones are “.edi” and “.x12”. Most companies treat ED files as text files, and give their EDI files the extension “.txt”; but we don’t recommend it because a “.txt” extension gives the impression that EDI files are text files, which is not true. EDI files are binary files and can contain graphics, like pictures and signatures in them.


What is the ASC X12 EDI format?
The Accredited Standards Committee X12 standard was developed for cross industry electronic exchange of information, which is widely used in North America. However, it is important to note that ASC X12 have many versions of Transaction Sets that must be determined to successfully exchange EDI files between trading partners.

An EDI X12 file contains Interchange(s), which consists of Functional Group(s), which in turn contain Transaction Set(s).

-----EDI Document
----------Interchange Header (ISA)
---------------Functional Group Header (GS)
--------------------Transaction Set Header (ST)
-------------------------Message segments
--------------------Transaction Set Trailer (SE)
--------------------Transaction Set Header (ST)
-------------------------Message segments
--------------------Transaction Set Trailer (SE)
--------------------…
--------------------…
---------------Functional Group Trailer (GS)
---------------Functional Group Header (GS)
--------------------Transaction Set Header (ST)
-------------------------Message segments
--------------------Transaction Set Trailer (SE)
--------------------Transaction Set Header (ST)
-------------------------Message segments
--------------------Transaction Set Trailer (SE)
--------------------…
--------------------…
---------------Functional Group Trailer (GS)
---------------…
---------------…
----------Interchange Trailer (IEA)
----------Interchange Header (ISA)
---------------Functional Group Header (GS)
--------------------Transaction Set Header (ST)
-------------------------Message segments
--------------------Transaction Set Trailer (SE)
--------------------Transaction Set Header (ST)
-------------------------Message segments
--------------------Transaction Set Trailer (SE)
--------------------…
--------------------…
---------------Functional Group Trailer (GS)
---------------Functional Group Header (GS)
--------------------Transaction Set Header (ST)
-------------------------Message segments
--------------------Transaction Set Trailer (SE)
--------------------Transaction Set Header (ST)
-------------------------Message segments
--------------------Transaction Set Trailer (SE)
--------------------…
--------------------…
---------------Functional Group Trailer (GS)
---------------…
---------------…
----------Interchange Trailer (IEA)
----------…
----------…
-----EDI Document End-of-File

What are control segments?

The control segments are the header and trailer segments that mark the start and end of their controlling structure.
· The X12 control segments of Interchange are the ISA (Interchanger Header),and the IEA (Interchange Trailer).
· The X12 control segments of the Functional Group are the GS (Functional Group Header), and the GE (Functional Group Trailer).
· The X12 control segments of the Transaction Set are the ST (Transaction Set Header), and the SE (Transaction Set Trailer).



What are data segments, data elements, and composite elements?
A data element is the smallest unit in an EDI file, and contains data that are separated by data element separators.

A data segment is a block of information made up data elements. Data segments are separated by data segment terminators.

A composite element is a data element that is further made up of data elements.


FREDI Examples:

'CREATING THE CLM DATA SEGMENT
Set oSegment = oTransactionset.CreateDataSegment("HL\CLM\CLM") 'CLM segment
oSegment.DataElementValue(1) = sPatientAccountNo '...first data element of CLM
oSegment.DataElementValue(2) = sChargeAmount '...second data element of CLM
oSegment.DataElementValue(5, 1) = "11" '...first subelement of fifth data element. (The 5th data element is a composite element.)
oSegment.DataElementValue(5, 3) = "1" '...third subelement of fifth data element.
oSegment.DataElementValue(6) = "Y" '...sixth data element
oSegment.DataElementValue(8) = "Y" '...eight data element
oSegment.DataElementValue(9) = "Y" '...ninth data element


What is a terminator?
A terminator is a string or a character, which is used to separate units in an EDI file. A segment terminator separates data segments. An element terminator separates data elements. A composite element terminator separates the sub data elements in a composite data element.

FREDI Example:
oEdiDoc.SegmentTerminator = "'" & vbCrLf
oEdiDoc.ElementTerminator = "+"
oEdiDoc.CompositeTerminator = ":"
oEdiDoc.ReleaseIndicator = "?"
oEdiDoc.DecimalNotation = "."


What is a release code indicator?
A release code indicator is a character that precedes an actual data to differentiate the data from a terminator character that is of a similar symbol.

FREDI Example:
oEdiDoc.SegmentTerminator = "'" & vbCrLf
oEdiDoc.ElementTerminator = "+"
oEdiDoc.CompositeTerminator = ":"
oEdiDoc.ReleaseIndicator = "?"
oEdiDoc.DecimalNotation = "."


What can I do if my data contains characters that are similar to terminator characters? (Topic: release code indicator).
In the X12 standard, EDI data must not contain any string similar to a string being used by a terminator. So if you are generating an EDI X12 file, you must strip off any string in your data that is similar to a terminator string before generating it into an EDI file.

In the UN/EDIFACT standard, you can define a release indicator, which is a string placed before the data string (that is similar to a terminator string) so as to denote that the conflicting data string is part of the data (and not a terminator).

FREDI manages the release code indicator automatically. All you need to do is to define the release code indicator string that will be used in the EDI document e.g.

oEdiDoc.SegmentTerminator = "'" & vbCrLf
oEdiDoc.ElementTerminator = "+"
oEdiDoc.CompositeTerminator = ":"
oEdiDoc.ReleaseIndicator = "?"
oEdiDoc.DecimalNotation = "."


How do I reference a composite element in FREDI?
A composite element can be referenced by the DataElementValue method of the ediSegment object. For example, segment SV1 has a composite element as the first data element; and to get the value of the second sub element you would do the following:

If oSegment.ID = “SV1” then
sHCPCSCode = oSegment.DataElementValue(1, 2)
Endif



What is an entity identifier? (Other topics: qualifier, loop instance)
An entity identifier is similar to a qualifier, but it is a code value in a data element that describes the information of a group of segments (the loop), and what they relate to. For example, the N1 loop can hold the “Ship To” and “Bill To” address, both using the same N1 loop but differentiated by the entity identifier in the first data element of the N1 segment.

'CREATES THE N1 SEGMENT IN LOOP N1 (SHIP TO)
Set oSegment = oTransactionset.CreateDataSegment("N1\N1")
oSegment.DataElementValue(1) = "ST" ‘Ship To entity identifier
oSegment.DataElementValue(2) = txtShipToName.Text
oSegment.DataElementValue(3) = "9"
oSegment.DataElementValue(4) = txtShipToDUNS.Text

'CREATES THE N3 SEGMENT IN LOOP N1 (SHIP TO)
Set oSegment = oTransactionset.CreateDataSegment("N1\N3")
oSegment.DataElementValue(1) = txtShipToAddress.Text

'CREATES THE N4 SEGMENT IN LOOP N1 (SHIP TO)
Set oSegment = oTransactionset.CreateDataSegment("N1\N4")
oSegment.DataElementValue(1) = txtShipToCity.Text
oSegment.DataElementValue(2) = txtShipToState.Text
oSegment.DataElementValue(3) = txtShipToZip.Text

'CREATES THE N1 SEGMENT IN LOOP N1 (BILL TO)
Set oSegment = oTransactionset.CreateDataSegment("N1(2)\N1")
oSegment.DataElementValue(1) = "BT" ‘Bill To entity identifier
oSegment.DataElementValue(2) = txtBillToName.Text
oSegment.DataElementValue(3) = "9"
oSegment.DataElementValue(4) = txtBillToDUNS.Text

'CREATES THE N3 SEGMENT IN LOOP N1 (BILL TO)
Set oSegment = oTransactionset.CreateDataSegment("N1(2)\N3")
oSegment.DataElementValue(1) = txtBillToAddress.Text

'CREATES THE N4 SEGMENT IN LOOP N1 (BILL TO)
Set oSegment = oTransactionset.CreateDataSegment("N1(2)\N4")
oSegment.DataElementValue(1) = txtBillToCity.Text
oSegment.DataElementValue(2) = txtBillToState.Text
oSegment.DataElementValue(3) = txtBillToZip.Text

This is also an example of an N1 loop having two different loop instances.



I’ve received an implementation guideline with no “Required” column for loops. How would I know if loops are mandatory or optional?
The first data segment of the loop determines the reference and requirement of loops (or groups of segments). If the first data segment of the loop is required, then the loop is mandatory. This is only true with the first data segment, and not with any other data segments in the loop. If segments in the loop are required other than the first data segment of the loop, then the loop is still optional. For example, an implementation guideline with the following information

N1 O
N3 R
N4 R

…states that the N1 loop is optional; but if the N1 loop is used, then the N3 and N4 segment must exist in the loop.


What does the “Repeat” or “Maximum Usage” in the implementation guideline mean? (Other topics: instances, qualifier, entity identifier)
The “Maximum Usage” column depicts the maximum number of instances a data segment can have.

For example, a DTP segment may have a maximum usage of 2, which means that the same DTP segment may be used repeatedly to hold two different dates identified by the qualifier of the DTP segment.

Set oSegment = oTransactionset.CreateDataSegment("DTP")
oSegment.DataElementValue(1) = “454” ‘Initial treatment
oSegment.DataElementValue(2) = “D8”
oSegment.DataElementValue(2) = “20010327”

Set oSegment = oTransactionset.CreateDataSegment("DTP(2)")
oSegment.DataElementValue(1) = “304” ‘Last visit
oSegment.DataElementValue(2) = “D8”
oSegment.DataElementValue(2) = “20031204”


The “Repeat” column depicts the maximum number of instance a loop can have.
For example, a N1 loop may have a repeat number of 3, which means that the loop or same group of segments can be repeated at most 3 times.


How are EDI files transmitted? (send, receive, AS2, X12.58, VAN)
EDI files are sent, and received in a number of ways depending on the agreement with your trading partner. Some still use VAN (Value Added Network) and may have proprietary software to send and receive EDI files; some may allow you to send it over the Internet either by FTP, HTTP or SMTP.

EDI allows any form of electronic transport as long as the EDI file is received in a correct EDI format without any human intermediary.

Framework EDI (FREDI) allows users to send EDI files through TCP/IP protocols – FTP, HTTP, HTTPS, SMTP. When sending EDI files over the Internet, it is prudent to secure them. FREDI also supports X12.58 security structures to secure EDI files.

FREDI also simplifies AS2 transmission of EDI files. AS2 or EDIINT is another popular method of securely sending EDI files over the Internet by HTTP.



What is SEF? And what is its purpose?
SEF or Standard Exchange Format is an open-standard, machine-readable format file that defines the EDI implementation guideline of a trading partner.

The purpose of SEF is to standardize the format of EDI implementation guidelines so that computers can obtain rules and conventions from them automatically.

The advantages of using SEF files are:
1. The guideline contents are immediately useable to both computer and user.
2. The open-standard format allows you to create your own SEF file and distribute it without permission or fees.
3. SEF files are very small in size and can easily be sent over the Internet.


FREDI uses SEF files to obtain the implementation guideline information so that it can parse and construct EDI files correctly. FREDI also uses SEF files to validate EDI files. The EDI document is checked against the corresponding SEF file, then if there are any discrepancies, they get saved into FREDI's warning object.



How can I get the the errors from the ediWarnings object?
FREDI stores the errors it finds in the ediWarning object. This object can then be interrogated to get the error details that were caught by FREDI.

Set oEdiDoc = New Fredi.ediDocument

'load sef
oEdiDoc.ImportSchema sPath & "837_X098.SEF", 0

'load edi file
oEdiDoc.LoadEdi sPath & "837OUTPUT.X12"

' Get errors display them in a list box
Set oWarnings = oEdiDoc.GetWarnings
nWarningCount = oWarnings.Count
If nWarningCount > 0 Then
For i = 1 To oWarnings.Count
Set oWarning = oWarnings.Warning(i)
List1.AddItem oWarning.Code & " " & oWarning.Description
Next
End If
Sample VB program that uses the warning object


When I generated my EDI 856 file, I noticed that the N1 loop is not in the correct place. Below is my syntax for creating the N1 loop inside the HL loop. Set oSegment = oTransactionSet.CreateDataSegment("HL\N1")
The syntax of a hierarchy string is a combination of loop tags that starts with the outermost loop (lowest) tag to the innermost (highest) tag, separated with a back slash (\), and then ending the string of loop tags with a data segment ID. Therefore the syntax to create the N1 segment belonging to the N1 group, which is nested in the HL loop should be:

Set oSegment = oTransactionSet.CreateDataSegment("HL\N1\N1")


What's the price for Framework EDI? (cost, license)
For pricing and licensing, please refer to our licensing webpage at http://www.edidev.com/license.htm



FREDI seems to be generating some segments with trailing terminators/separators, which have no values. How can I suppress these terminators?
Trailing terminators occur when the last data element of a segment is mandatory, but no value has been assigned to it. For example, if the convention for a REF segment is as shown below…

REF01 – Reference ID Qualifier, M, ID, 2, 3
REF02 – Reference ID, O, AN, 2,3
REF03 – Description, O, AN, 80, {MUST USE}

…but was assigned the following values…

REF01 = “11”
REF02 = “123-45-6789”
REF03 = {null, no values assigned)

…then FREDI will generate the following REF segment…

REF*11*123-45-6789* ~

The last data element (REF03) still gets generated by FREDI (because it is a mandatory data element) but has an ‘empty space’ value, which makes the REF segment seem that it has an extra trailing terminator.


When I load the sample program “ExcelGen810”, and try to run it, I get a “Compile Error: Object library feature not supported” error.
This happens when the excel spreadsheet is converted or being run on a later version of Excel than version 2000. To resolve this problem, you must remove the FREDI reference, and then add it back again by doing the following:

- From Excel’s Visual Basic Editor, go to menu “Tools”, then “References”.
- Unselect “EDIdEv Framework EDI” from the reference dialog box.
- Click on the “OK” button.
- Go back to the reference dialog box by going to “Tools”, then “References”.
- This time, select “EDIdEv Framework EDI” from the reference dialog box.
- Click on the “OK” button

What's the difference between a Runtime License and a Server Runtime License?
Server Runtime licenses ($450) are for applications that can run only on servers e.g. web apps and server services. It can also be used as a site license meaning you can purchase one server runtime license to deploy it onto all of the computers at that site. (The Server Runtime includes the eFileManager, eSecurity Console and the ISAPI extension, while the standard Runtime does not.)

The standard runtime license ($100) is per computer, and is used for
applications that can run on workstations. If your application can run on a workstation, but is installed on a server, you can still use the standard runtime license.


What's the difference between the FREDI Enterprise and Professional License?
The FREDI Enterprise is a site license, while the FREDI Professional is a user license. Also, the Enterprise License includes all the SM Plug-Ins, the FREDI ISAPI extension, the eSecurity Console, and 2 Server Runtime Licenses, while the Professional License does not include them.

The eAnalyzer reports that I have some warnings, but no errors. What is the difference between them?
Warnings are discrepancies found in the EDI file when it was validated against the implementation guideline contained in a schema (SEF File).

Errors are all other problems (not relating to the implementation guidelines), which occurred when FREDI was trying to validate the EDI file. These types of problems are likely severe errors that could break the validation process.


Can I save an EDI file into a string, instead of a file?
Yes. Instead of using the save method, you would use the GetEdiString method of the ediDocument object. Example

sEdi = oEdiDoc.GetEdiString()


Please refer to documentation. (Under "Contents" tab, select "Framework EDI Reference", then "Methods and Properties", then "ediDocument")

When I install FREDI 5.2 I get the following error message: "The dynamic link library MSVCR71.dll could not be found in the specified path [path string..]"
This is caused by the installer failing to find the MSVCR71.dll in the path. Please refer to microsoft knowledgebase for the solution at http://support.microsoft.com/default.aspx?scid=kb;en-us;870717

When I install FREDI 5.2, I get a "failed to install" message at the end.
This error could be caused if you have .NET 1.0. The FREDI installer failed to install the FREDI .NET component to the GAC. The solution would be to install it manually using the gacutil.exe. For instructions on how to use the gacutil, please refer to Microsoft's knowledgebase http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfglobalassemblycacheutilitygacutilexe.asp

Or you can upgrade your .NET runtime by installing the Dotnetfx.exe. You can download it from http://msdn.microsoft.com/netframework/downloads/updates/default.aspx


When I use the FREDI 5.2 NetHybrid, I get the following error in ASP.NET or when I use threading: [Code:12371] "Failed to connect source and sink with SEF engine 'EDIdEV.sefEngine'" or [DESCRIPTION:Failed to load Standard Exchange Format (SEF) component. Description=CoInitialize has not been called.,SCODE=ox800101f0.][CODE:12560]
These errors occur because FREDI NetHybrid still requires to load COM, and therefore the proper settings in .NET have to be set to support it.

To resolve the problem in threading, you have to set the concurrency of the thread apartment as single threaded - STA. The STA concurrency is required because the FREDI COM components work in this mode only. (By default, .NET makes the thread a multiple threaded apartment - MTA)
For example in VB.NET:

t.ApartmentState = Threading.ApartmentState.STA

In ASP.NET, you would have to enable existing ASP intrinsic interfaces that allow COM support by including the following setting in the Page directive:
< %@ Page ASPCompat="true" % >
Threading in VB.NET using FREDI 5.2 NetHybrid


Is it possible to insert a new segment into an existing EDI file with the FREDI component?
Yes, it is possible, but FREDI does not have a built-in method or function to do it. Basically, it would require some programming. One logic would be to load the EDI file in Dynamic cursor type, and then get the transaction set object and traverse through each segment, keeping track of the loop instances, then at the loop where you want the segment inserted is where you would call the CreateDataSegment passing the complete hierarchy string. Example

oEdiDoc.ImportSchema sPath & sSefFile, 0
oEdiDoc.LoadEdi sPath & sEdiFile

'Get transaction set
Set oInterchange = oEdiDoc.FirstInterchange
Set oGroup = oInterchange.FirstGroup
Set oTransactionSet = oGroup.FirstTransactionSet

'traverse thu segments
Set oSegment = oEdiDoc.FirstDataSegment
Do While Not oSegment Is Nothing

...

If sSegmentID = "CLM" Then
ClmCount = ClmCount + 1
LxCount = 0

sHlCount = Trim(Str(HlCount))
sClmCount = Trim(Str(ClmCount))

'insert HCP segment in CLM loop
Set oSegment = oTransactionSet.CreateDataSegment("HL(" _
& sHlCount & ")\CLM(" & sClmCount & ")\HCP")
oSegment.DataElementValue(1) = "10"
oSegment.DataElementValue(2) = "210"
End If

...

'get next segment
Set oSegment = oSegment.Next
Loop

'save to a new file name
oEdiDoc.Save sPath & "New_" & sEdiFile



Is it possible to remove a data segment from an existing EDI file?
Yes, with the RemoveDataSegment method of the ediTransactionSet object. Example:

oEdiDoc.LoadSchema sPath & sSefFile, Schema_Standard_Exchange_Format
oEdiDoc.LoadEdi sPath & sEdiFile

Set oInterchange = oEdiDoc.FirstInterchange
Set oGroup = oInterchange.FirstGroup
Set oTransactionSet = oGroup.FirstTransactionSet

Set oSegment = oTransactionSet.FirstDataSegment

Do While Not oSegment Is Nothing
sSegmentID = oSegment.ID
sLoopSection = oSegment.LoopSection
nArea = oSegment.Area

'Delete the PID segment
If sSegmentID = "PID" Then
nHandle = oSegment.Handle
Set oSegment = oSegment.Next
oTransactionSet.RemoveDataSegment nHandle
Else
'Get next segment
Set oSegment = oSegment.Next
End If

Loop

'Save as a new EDI file
oEdiDoc.Save sPath & "New_" & sEdiFile


Is it possible to obtain the description of code values in a data element using the FREDI component?
Yes. As of FREDI version 4.1.2002.185, this is an undocumented method of obtaining the descriptions of codes in a data element. There may be backward compatibility issues with later releases of FREDI. But for those that need to obtain the code descriptions now, here is a method of doing it:

VB Example
-----------
Dim oCodes As Object
Dim oCodeMap As Object
Dim sCodeDescription As String

Set oCodes = CreateObject("EDIDEV_X121A4012.ResourceGate")
Set oCodeMap = oCodes.GetCodesMap
sCodeDescription = oCodeMap.Description("I01", "00") ' First parameter is the element id, and the second parameter is the code value


C# Example
-----------
System.Type oType = System.Type.GetTypeFromProgID("EDIDEV_X121A4012.ResourceGate");

object oCodes = System.Activator.CreateInstance(oType);
object oCodesMap = oType.InvokeMember("GetCodesMap", System.Reflection.BindingFlags.InvokeMethod, null, oCodes, null );

string sElementDesc = (string) oType.InvokeMember("Description", System.Reflection.BindingFlags.InvokeMethod, null, oCodesMap, new object[] {"I01","00"}); //First parameter is the element id, and the second parameter is the code value

MessageBox.Show(sElementDesc);



I’m generating an EDI file with multiple transaction sets (about 100 in a group). I’ve already changed the cursor type to “Forward_Write”, but I’m finding that my program still slows down as more transaction sets get created. Is there anymore I can do to improve performance?
When generating EDI files with multiple transaction sets, the main culprit of performance degradation is the bottleneck caused by the disk-write. To improve performance, one can set the “DocumentBufferIO” higher so that FREDI does not commit to disk as often. Example:

oEdiDoc.Property(Property_DocumentBufferIO) = 2500

Sample program that generates an EDI file with multiple Transaction Sets


What is the “measuring stick” that I can use to compare the performance of my program to know that I’ve effectively used Framework EDI? I’ve written a program that translates multiple EDI files of about 2MB, which takes about 15 minutes for each file. I have a 1Ghz computer with 256MB RAM, and I’m wondering if I can improve the performance any faster.
As a “measuring stick”, Framework EDI can at least translate a 1MB EDI file in 1 min on a 1 GHz computer. So in your scenario, your program can be improved to translate each 2MB EDI file in 2 minutes or less.
sample VB NET program that translates fifteen 2MB EDI files


We have several trading partners sending us EDI X12 850 4010 files, but they all have different implementation guidelines. Is there a way for FREDI to automatically select the correct SEF file from among the many SEF files we have created for each of the different types of EDI files? (LoadSchemaBySetValue, Schemas)
Yes. FREDI can select a SEF file among many SEF files based on a value in the EDI file. These are the steps to the solution:

1. In the INI section of each SEF file, give each file a unique implementation name e.g.
INI
CompanyA_850-4010,,004 010,X12,

2. In your program, use the LoadSchemaSetValue method to tell FREDI which SEF file to use when a certain value in an EDI file is found e.g. when an 850 EDI file with REF02 has a value of “A8765”, then use SEF file with implementation name “CompanyA_850-4010” and version 004 010.

oSchemas.LoadSchemaBySetValue "850", "REF", 2, 0, "A8765", "004 010\CompanyA_850-4010"


sample VB6 program that demos how to use the LoadSchemaBySetValue


When deploying my program with the FREDI Runtime License, I get the error message “File or assembly name EDIdEv.FrameworkEDI.NET, or one of its dependencies, was not found. File name: EDIdEv.FrameworkEDI.NET\”.
To resolve the "File or assembly name EDIdEv.FrameworkEDI.NET, or one of its dependencies, was not found" error, try the following:

One reason for this error is that the client application is not able to locate the assembly. First verify that the FrameworkEDI assembly got installed correctly by taking the following steps.

1. Verify if assembly is installed into the GAC. Go to C:\WINDOWS\ASSEMBLY folder and verify if EDIdEv.FrameworkEDI.NET exists.

2. Go to the install target path (e.g. Program Files\Edidev\Bin) and verify that the file EDIdEv.FrameworkEDI.NET.DLL is installed.

3. Verify that the version in the target path and in C:\WINDOWS\ASSEMBLY folder are the same.


If the assembly was correctly installed, then the error may be that you may have installed a different version of EDIdEv.FrameworkEDI.NET from the version in your client app, which may have been developed with an earlier version of Framework EDI assembly. This is a feature of the .NET runtime in its ability to allow side-by-side execution, and has nothing to do with backward compatibility issues of FREDI. To overcome this problem, either rebuild the client app again to reference the new version of FREDI; or use a configuration file to redirect your client app to use a different version of FREDI. To rebuild the client app, do the following:

1. Launch Visual Studio .NET and open the project.

2. Under project open the folder "References", then delete the reference "EDIdEv.FrameworkEDI.NET".

3. Right click on the folder "References" and select the option "Add Reference".

4. In the .NET tab, select "EDIdEv.Framework.NET", click "Select", then "OK". FrameworkEDI assembly should now be listed below the "References" folder.

5. Highlight "EDIdEv.FrameworkEDI.NET", click "Properties", and in the properties window verify the following:

Name = EDIdEv.FrameworkEDI.NET
Copy Local = True
Strong Name = True

6. Build the solution.


Or, instead of rebuilding the program, you can create a configuration file to indicate to the client app that a newer version of EDIdEv.FrameworkEDI.NET was installed. To create the exe configuration file, do the following:

1. Determine the version of the new assembly. This can be checked in the C:\WINDOWS\ASSEMBLY folder.

2. Determine the version that the component is using. The detail error dump that you got should give this information. For example, in the following text:

=== Pre-bind state information ===
LOG: DisplayName = EDIdEv.FrameworkEDI.NET, Version=5.2.2005.485, Culture=neutral, PublicKeyToken=366ef3324f08b1d2
(Fully-specified)
LOG: Appbase = C:\fredi\test LOG: Initial PrivatePath = NULL
Calling assembly : NetGenString, Version=1.0.2285.32670, Culture=neutral, PublicKeyToken=null.


In this dump, the version that the client app is looking for is version "5.2.2005.485".

3. Assuming that the name of the client app is "Project1.EXE", create a configuration file with a filename having the following syntax:

[app name][.config]

In our example, our filename will be "Project1.EXE.config". Make sure to save this file into the same folder as the app Project1.EXE.

4. Assuming that the new version installed is "5.2.2005.488". Open the "Project1.EXE.config" file using notepad, and enter the following text.

(Please download "Project1.exe.config" file from the link below to obtain the text.)

Notice the element "bindingRedirect" shows the new version, which would be used by the client app.
Project1.exe.config


How does the Framework EDI (FREDI) component support all the X12 and UN/EDIFACT EDI documents?
Framework EDI (FREDI) is able to process all EDI files that follow the X12 and UN/EDFACT standards by using Standard Exchange Format (SEF) files. SEF files are machine-readable text files that contain the implementation guideline of a trading partners EDI documents. So for the FREDI components to process any EDI files, the corresponding SEF file has to be loaded into it first. SEF files can be obtained from your trading partner, or can be purchased from our company’s eShop at www.edidev.com.

When I reinstalled my runtime license with the latest version of the runtime update, my .NET application failed to run with a “File or assembly name EDIdEv.FrameworkEDI.NET, or one of its dependencies, was not found.”
This problem occurs when you’re application is using the FREDI-NET hybrid component. Unlike COM components, the .NET components are version sensitive to allow side-by-side execution. This is a feature of .NET, and has nothing to do with FREDI’s backward compatibility issue. So when the FREDI runtime update was installed, it removed the old version of the FREDI-NET component and installed in the new version of the FREDI-NET component. However, your application is still referring to the old FREDI-NET component, which got removed, and thus causing the error.

A simple fix to this problem is to update your FREDI development license with the same version as the runtime update, and then recompile your program before redeploying your application with the new runtime update.

Or, instead of rebuilding the program, you can create a configuration file to indicate to the client app that a newer version of EDIdEv.FrameworkEDI.NET was installed. To create the exe configuration file, do the following:

1. Determine the version of the new assembly. This can be checked in the C:\WINDOWS\ASSEMBLY folder.

2. Determine the version that the component is using. The detail error dump that you got should give this information. For example, in the following text:

=== Pre-bind state information ===
LOG: DisplayName = EDIdEv.FrameworkEDI.NET, Version=5.2.2005.485, Culture=neutral, PublicKeyToken=366ef3324f08b1d2
(Fully-specified)
LOG: Appbase = C:\fredi\test LOG: Initial PrivatePath = NULL
Calling assembly : NetGenString, Version=1.0.2285.32670, Culture=neutral, PublicKeyToken=null.


In this dump, the version that the client app is looking for is version "5.2.2005.485".

3. Assuming that the name of the client app is "Project1.EXE", create a configuration file with a filename having the following syntax:

[app name][.config]

In our example, our filename will be "Project1.EXE.config". Make sure to save this file into the same folder as the app Project1.EXE.

4. Assuming that the new version installed is "5.2.2005.488". Open the "Project1.EXE.config" file using notepad, and enter the following text.

(Please download "Project1.exe.config" file from the link below to obtain the text.)

Notice the element "bindingRedirect" shows the new version, which would be used by the client app.

project config sample file


What programming language is Framework EDI written in?
Framework EDI is written in C++

I’m using the FREDI .NET Hybrid component in my ASP .NET program, but seems so much slower than when I was using the FREDI COM especially when loading the SEF file and EDI file.
This is most likely a threading issue. FREDI .NET Hybrid still requires the FREDI COM components so your ASP .NET programs must have the following setting in the Page Directive to allow COM support:

ASPCompat="true"


Are there any settings in FREDI that I should change so as to improve its performance for processing larger EDI files?
The following settings are recommended when processing larger EDI files:

1. When reading (inbound) EDI files:
- Change the CursorType of the ediDocument object to “Cursor_ForwardOnly”
e.g
oEdiDoc.CursorType = Cursor_ ForwardOnly

2. When generating (outbound) EDI files:
- Change the CursorType of the ediDocment object to “Cursor_ForwardWrite”
- Increase the DocumentBufferIO
e.g.
oEdiDoc.CursorType = Cursor_ForwardWrite
oEdiDoc.Property(Property_DocumentBufferIO) = 2000


3. Disable the internal Standard Reference Library
e.g.
Set oSchemas = oEdiDoc.GetSchemas
oSchemas.EnableStandardReference = False

4. Do not use the FREDI-COM in .NET applications. We strongly recommend that you use the FREDI-NET component in .NET environments. Also, when using the FREDI .NET component, we recommend that you use the “Set” method to instantiate FREDI objects, and the “Dispose” method to release the FREDI objects.
e.g. use the following syntax in VB .NET

ediDataSegment.Set(oSegment, oSegment.Next)

instead of
Set oSegment = oSegment.Next

5. When using FREDI-NET component in ASP .NET programs. Make sure to set the ASPCompat=”true”.
e.g.
< %@ Page ASPCompat=”true” % >


When I test the FREDI warning object in my ASP .NET web program, I get the following error [DESCRIPTION:Failed to connect source and sink with SEF Engine 'EDIdEV.sefEngine'. Connection Point failed to establish connection to source. Interface not supported. (0x80004002)][CODE:12371] But, testing the same EDI file on a .NET windows application with a similar source code does not generate the error.
This is a known error that occurs when using the .NET Hybrid component, but it's not an error that will stop all functionality of the object and so is generated as a warning. This error happens because the SEF object, which is a COM component, is attempting to connect to FREDI in order to send events to it. This works if FREDI is a COM component, but it cannot connect to the Framework EDI .NET component. Though the error does not affect the validation process of the component, the problem is still captured into the warning object so as to notify the client. The error is not severe because the only time when the SEF object ever sends an event to the FREDI .NET component is when it is loading and unloading a SEF file.

This error can be excluded from the warning object by suppressing the error number in the ediDocument property by doing the following:

C#
--
oEdiDoc.set_Property(Edidev.FrameworkEDI.DocumentPropertyIDConstants.Property_SuppressedErrors,12371);

VB
--
oEdiDoc.Property(Edidev.FrameworkEDI.DocumentPropertyIDConstants.Property_SuppressedErrors) = 12371


The FREDI component finds some errors that I do not want to include in the 997 Functional Acknowledgment. Is there a way to suppress (ignore)these errors?
Yes, errors can be suppressed by using the Property_SuppressedErrors property of the ediDocument object. Simply specify the error number of the error(s) you want suppressed to the property by doing the following:

Set oEdiDoc = New Fredi.ediDocument

oEdiDoc.Property(Property_SuppressedErrors) = “6016”

A list of errors can be suppressed by adding to the string separated by semi-colon:

oEdiDoc.Property(Property_SuppressedErrors) = “6016;12321;13814”



Is there a way to have FREDI recognize Spanish and French (or other international) characters as alpha-numeric type so that it does not detect them to be invalid characters?
Yes, it is possible to add special characters so that FREDI can recogniize them to be valid character types by using the ediSyntaxLevel object. For example:


Set oSyntaxLevels = oEdiDoc.GetSyntaxLevels
Set oSyntaxLevel = oSyntaxLevels.AddSyntaxLevel("ASC X12") 'For ASC/X12 only.
oSyntaxLevel.AddCharacterRepertoire "àáâäãåÀÁÂÄÃÅèéêëÈÉÊËìíîïÌÍÎÏòóôöõÒÓÔÖÕùúûüÙÚÛÜçÇñÑß¿¡" ' Special characters.
oSyntaxLevel.AddAlphabetRepertoire "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" ' Alphabetic characters.
oSyntaxLevel.AddNumberRepertoire "1234567890" ' Numeric characters.
sample Ack program with Syntax Level


When I try to import my security certificate using the FREDI import functionality, I get a 13370 error: “Failed to add certificate. CertAddEncodedCertificateToStore API Failure. Description: ASN1 bad tag value met.”
This error is normally caused when you are trying to import a security certificate of a type other than DER or BER encoded X509 certificate. The current version of FREDI (v5.3) cannot import base64-encoded certificate nor PFX.

Does Framework EDI support multiple trading partners?
The Framework is a component that makes it possible for you to develop an EDI solution to support multiple trading partners. The link below is a sample program that demonstrates how it is possible.
sample program that demos how to support multiple trading partners


Does Framework EDI work with Java?
The Framework EDI (FREDI) components are COM and .NET, so programming languages have to support these type of components to utilize FREDI. Also, the FREDI components have to be installed in Windows operating systems.

Although, we have not tested the FREDI component with the following solutions, below are a couple solutions we know that allow you to support COM in Java:

- Suns JNI library
- JNIwrapper at www.jniwrapper.com


My program breaks on the line where I’m instantiating an ediDocument object. I’m getting an error message “CoInitialize has not been called”.
The CoInitialize(NULL) or CoInitialize(0) is called to initialize the COM library, and if this is not called then no COM functionality will work - it will break during the call to creating a new instance of a COM interface. For example, the VB statement:

Set oEdiDoc = New ediDocument

OR

Set oEdiDoc = CreateObject('FREDI.ediDocument')

will break. This function MUST be called for each thread in the program.

The reason why you do not have to call this statement in the VB development environment when writing a simple program is because the VB program (same for Delphi, Visual FoxPro) internally calls this function. But it's called only on the main thread. So if the client program spawns new threads then at the beginning of each new thread this function MUST be called.

Some things to consider when using this function.
1. Applications developed today should call CoInitializeEx rather than CoInitialize.
2. Each call to CoInitialize or CoInitializeEx must be balanced by a corresponding call to CoUnitialize.
3. Currently Framework EDI works only under a single-threaded concurrency model, so if this function has to be called, the client should use:

Private Declare Function CoInitialize Lib "OLE32.DLL" (ByVal pvReserved As Long) As Long
Private Declare Function CoUninitialize Lib "OLE32" ()
:
CoInitialize(0)
:
(do stuff)
:
CoUninitialize


OR

Private Const COINIT_APARTMENTTHREADED = 2 'Apartment model
:
Private Declare Function CoInitializeEx Lib "OLE32" (ByVal pvReserved As Long, ByVal dwCoInit As Long) As Long
Private Declare Function CoUninitialize Lib "OLE32" ()
:
CoInitializeEx(0, COINIT_APARTMENTTHREADED)
:
(do stuff)
:
CoUninitialize


Is it possible to install the Runtime License in silent mode (command line)?
Yes, you can call the Framework EDI Runtime License from a command line with the following syntax:

Edidev_Fredi_Runtime.exe -s< Serial number > -p< Target Path >

Where:

< Serial number > indicates the license serial number without any dashes
< Target Path > indicates the path to install the files.


Can the FREDI FTP protocol be used in passive mode?
Yes. You can enable the passive mode in the component's FTP configuration by doing the following:

Dim oFtpCfg As Fredi.ediFtpCfg
Set oFtpCfg = oTransport.GetFtpCfg
oFtpCfg.EnablePassive = True


For Example:

' Send EDI file using FTP and SMTP
Set oTransports = oEdiDoc.GetTransports

' Send as FTP
Set oTransport = oTransports.CreateTransport
oTransport.SetFTP
oTransport.Address = "www.domain.com"

oTransport.Password = "password"
oTransport.User = "userID"
oTransport.TargetPath = "..\..\folder\"

Dim oFtpCfg As Fredi.ediFtpCfg
Set oFtpCfg = oTransport.GetFtpCfg
oFtpCfg.EnablePassive = True

' List remote files
Dim oDir As Fredi.ediFiles

If oTransport.TestConnection Then
Set oDir = oTransport.GetDirectory
For i = 1 To 2
MsgBox oDir.GetFileByIndex(i).FileName
Next
End If


While in debug mode, I get the following error: LoaderLock was detected Message: DLL 'C:\WINDOWS\assembly\GAC\EDIdEv.FrameworkEDI.NET\5.3.493.28__366ef3324f08b1d2\EDIdEv.FrameworkEDI.NET.dll' is attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.
The LoaderLock message is just a warning, and detected only during debugging mode. (The message does not occur in EXE mode.) From our tests of our components, we have not encountered any hanging. This warning happens because the FREDI-NET component is a hybrid, which is managed code, but still using the FREDI COM. The FREDI-NET component is basically a wrapper around the FREDI-COM component.

This warning message can be avoided by doing the following in VS2005:
- From the menu select Debug, then Exceptions
- From the Exception tree, open Manage Debugging Assistant
- then uncheck Loader Lock

Some programming recommendations when using the FREDI-NET component can be found at http://www.edidev.net/edidev-ca/help/Using/Using_DotNetHybrid/Using_DotNetHybrid.htm.

For sample programs using the FREDI-NET component, please visit http://www.edidev.com/edidev_VbNet.htm.


Do you have a list of all the Framework EDI error codes and their descriptions?
The list of error codes and their descriptions can be found in the help documentation included with the Framework EDI. (Go to the "Contents" tab, then select "Errors"). An error description can also be viewed by entering the error number with the ‘htm’ extension at the end of this link http://www.edidev.net/edidev-ca/help/Errors/.

For example error code 12371 is at link http://www.edidev.net/edidev-ca/help/Errors/12371.htm

When I deploy my program to our server, I get an error message; but the same program works on my development machine.
To troubleshoot your program deployment on the server, check the following:

1. Check that the Framework EDI component was successfully installed by running the eFileManager utility. (Make sure that you can open an EDI file.)

2. If your program is a service or a web application, make sure that the client account it is using has read privileges to the program files edidev\bin folder and read\write privileges to the edidev\temp folder.


I’ve written a web application in ASP.NET using the FREDI component, but I’m getting an error "Could not load file or assembly 'EDIDev.FrameworkEDI.NET, Version=5.3.491.11, Culture=neutral, PublicKeyToken=366ef3324t08b1d2' or one of its dependencies. Access is denied." I’ve already reinstalled FREDI, and have tested that the utilities work. I’ve also made sure the accounts IUSER…, and ASPNET have read/write access to the “Program Files\EDIdEV” folder, but the error persists.
This error is caused because the account the ASP pages are executing under do not have read/write permission to the “Program File\EDIdEv” folder. Make sure to give the following accounts read/write privileges to the “Program File\EDIdEv” folder:

NETWORK SERVICE – Windows 2003 O/S servers
ASPNET – All other Windows O/S

Or, if you wish your web application to impersonate the security context of the user account making the page request (for example the default anonymous login account is IUSER…), then add the following line in the web.config file (within the system.web block).

identity impersonate=”true”

In this case, you have to make sure that the user accounts have read/write permission to the “Program File\EDIdEv” folder.


In your eSecurity Console Utility, how do I change the Cryptographic Service Provider when I am viewing the Certificate Stores?
When you open the eSecurity Console, the first thing it does is it enumerates all the Cryptographic Service Provider (CSP). When it is all listed, select the CSP of your choice then right-click on it, then select "Certificate Operation" from the action menu.


When generating an 837 EDI file, I find that the 5th data element of the CTP data segment has no value (missing, null, not created) even though I've populated it in my code. Set oSegment = oTransactionset.CreateDataSegment("HL\CLM\LX\LIN\CTP") oSegment.DataElementValue(1) = "" oSegment.DataElementValue(2) = "" oSegment.DataElementValue(3) = "20.0" oSegment.DataElementValue(4) = "1" oSegment.DataElementValue(5) = "ML"
If you view the SEF file with the SEF Manager, you will find that the 5th element of CTP is a composite element. So you have to include the the postion number of the component element that will hold the value in the second parameter of the DataElementValue method. The syntax should then be:

oSegment.DataElementValue(5,1) = "ML"


What are the steps and the syntax to reference a data segment (or data element) in FREDI?
First, load the SEF file into the SEF Manager, and then locate the data segment or element you wish to reference noting all the loops the segment is under. The hierarchy syntax would then be the series of loop tags (starting from the top most) separated by a backslash “\” and then ending the string with the segment ID. For example, in an 850 EDI, the CTP segment can be referenced as “PO1\CTP\CTP” meaning that the CTP is under the CTP loop, which is a sub-loop of PO1.

For more details on the hierarchical string syntax please see the help documentation under the topic “Using Framework EDI”, “Syntax”. Or visit the link http://www.edidev.net/edidev-ca/help/Overview_GettingStarted/HierarchicalStringSyntax.htm


Do I need to create a different SEF file for each trading partner even though the transaction set (document) and version are the same?
If your trading partners have different user requirements or conventions; and if you want to check for these specifications in your validation of their EDI files, then yes you would have to create separate SEF files for each of your trading partner.

If validating the specific requirements of each trading partner is not important to you, then it is possible to use one generic SEF file (which has no user requirements or conventions in it) for processing the same corresponding type and version EDI files of all your trading partners.


I can’t seem to find the Runtime License in your eShop at your website. How can I purchase Runtime Licenses?
The Runtime Licenses are only available to Customers that already own a developer’s license (either the Professional or Enterprise License), and are therefore only available in the eShop at the Customer Support website. So if you already own a developer’s license and have a login, please use the eShop in our Customer Support website to purchase the runtime license and all other items.

If this is your first time purchasing from the eShop, and would like to purchase a developers license (Professional or Enterprise) and some runtime licenses, then you would have to purchase the developer’s license first. You will then receive an email with a download link and serial number for the developer’s license along with a login to our Customer Support website where you can then purchase the runtime licenses.


When validating an EDI file, I get an error message regarding a rule syntax has been violated for a data segment. How do I view the Syntax Rule of a segment with the SEF Manager?
You can view the Syntax Rule of a segment by opening the SEF file with the SEF Manager, and then taking the following steps:

- Expand the "Data Segments Directory (.SEGS)" section
- Find the data segment, and then expand it.
- Find the Syntax Rule node, and then expand it.


How can I determine the corresponding implementation guideline (SEF) - type and version - of my EDI X12 file?
You can determine the version of the guideline that your EDI file is following by looking at the eighth data element of the GS segment (GS08). An example of a value is 4010.

In addition, the transaction set number of an EDI X12 file can be determined by viewing the first data element of the ST segment (ST01). An example of a value is 850.

An example header of an 850 4010 EDI file
-----------------------------------------------------
ISA*00* *00* *ZZ*SENDERISA *14*007326879…
GS*PO*SENDERGS*007326879*19960807*1548*000001*X*004010~
ST*850*000000001~

From our above example, you would need the 850_4010 SEF file to process the EDI file.


How can I check the version of my Framework EDI component?
One method of checking the version of the FREDI component is to right-click on the fredi.dll file (in the default directory C:\Program Files\edidev\BIN), then select “Properties” from the pop-up menu, and then click on the “Version” tab.

Another method is to run the eFileManager or eAnalyzer utility, and then select the “About” from their menu.


I am getting the following error [DESCRIPTION:EXCEPTION: (typereadtset_step(2834)) General Exception. ][CODE:12204]. This error is occurring in both my .NET program and the eFileManager application.
If this error occurs in both your .NET program and eFileManager, then generally, the problem is with the SEF file. View the SEF file with the SEF Manager to see that it is not corrupt. Specifically, inspect the position numbers of the segments to make sure that their values are valid and matches with the implementation guideline.

(Please note that the instances of the same loops/groups or segments have the same position numbers.)


When validating an EDI file, I get an error stating “Data Element designated ‘NOT USED’ contains data segment…CODE 13832”, but according to the SEF file, the element requirement is “USED”.
Two other rules for the data element may be overriding the element requirement ‘USED’. They are: the Semantic Rule; and the Syntax Rule.

Using the SEF Manager, open the SEF file and locate the data element of issue. To view the Semantic Rule for the data element, simply expand the “Semantic Rules” node below the data element node.

To view the Syntax Rule for the data element, find the related data segment of the data element in the Data Segment Directory (.SEG) and then expand it. The Syntax Rule node will be located after all the data element nodes.


What could be causing this error in my web application program Exception Details: Edidev.FrameworkEDI.ediException: [DESCRIPTION:ActiveX/COM dispatch exception. Description=[DESCRIPTION:CreateFile API Failure. Description: Logon failure: unknown user name or bad password., GetLastError() = 1326][CODE:12316]. Code=12316.][CODE:13844]
This error could be caused by the following:

- The web client application cannot find the EDI file or SEF file in the path specified by your program. Make sure the files and folders do exist.

- The web client application may not have enough rights to read/write on the specified paths of the SEF and EDI file.

- Make sure that the web application has read rights to the “Program Files\EDIdEv” folder


I have an EDI file that does not convert to XML format correctly. It is missing the Interchange-Control tag.
This problem happens when the segment terminator of the IEA segment of the EDI file is not consistent with the rest of the data segments. This normally happens with EDI files that have the CR/LF as their segment terminator, which is often carelessly left out on the last IEA segment.

What's the text section (.TEXT) of a SEF file? And why don't your SEF files have them?
The text section of the SEF file contains the verbose description of the schema.

For performance purposes, we have not included the text section in our SEF files so that the FREDI component can take the description from within itself internally. However, if you include text in the text section, the component will read it and override its own description.

For more about SEF's, please read the SEF.pdf at http://www.edidev.com/SEF.htm


What are external codes? And why don't your SEF files have them?
External codes are other codes that are not part of the X12 or UN/EDIFACT standards, but are created by industries, organizations and companies.

External codes can be added into the SEF file, and the FREDI component can read them just like the rest of the standard codes. For details on how to add codes into a SEF file with the SEF Manager, please read http://www.edidev.com/articles/createIG/HowToCreateIG.html

When I add the EDIdEv Framework EDI reference to my project, all my Try Catch Exception code is getting an error.
The error can be avoided by explicitly specifying the Exception to be a System.Exception e.g.

Catch Err as System.Exception



My FREDI Professional developer license is an older/previous version(v5.3) than the runtime license (v.5.4) available in your eShop. Do I have to upgrade/update just to buy a runtime license?
If your application is written in .NET, then you have to update your
developer license so that it's current with the runtime license. (.NET
programs are version sensitive for all components - not just for FREDI). You can download the latest FREDI updates of your version for free from the Download Update page in our Customer Support website.

If your program is not .NET then you do not have to update your developers license. However, I would still recommend updating your developers license because we only support updated licenses.


I want to upgrade the Framework EDI component on my server that is running our company’s EDI system. Do you have any recommended steps before running the FREDI update?
We recommend taking the following steps:

1. Make a note of the FREDI version you have currently installed on your server and development machine.
2. Update FREDI in your development machine, and rebuild your EDI application.
3. Thoroughly test your EDI application in development machine with actual EDI files.
4. Back-up your server
5. Close all applications and IIS server on server machine
6. Finally, update FREDI on server, and re-install your recompiled EDI application.


Is it possible to edit, change and modify evaluation SEF files?
No. Evaluation SEF files cannot be modified. If you wish to edit and make modifications to SEF files you would have to purchase the SEF files from our eShop.

However, the evaluation SEF Manager can be used to edit, change and modify purchased SEF files.


What are the differences between the custom SEF files (e.g. 837_004010X098A1) listed for $90 from the other version SEF files (837_004010.SEF) listed for $35?
The custom SEF files listed under the “EDIdEvProducts & Custom SEF files” in our eShop include industry conventions in them. Basically, the custom SEF files are standard SEF files that we’ve edited to include guideline requirements for a specific industry.

Can the FREDI component read an EDI file with multiple claims (and multiple providers)? And how does it handle it.
The FREDI component is a generic parser that can read any EDI file that follows the X12 or UN/EDIFACT standard, and is not specific to any one industry. It supports EDI files with multiple interchanges, multiple groups and multiple transaction sets. So to create a translator to read EDI files with multiple claims, you would use the FREDI component for parsing the EDI files, but you would have to write your own algorithm to handle the parsed data and provide the business logic.

Example programs on how to use the FREDI component to process EDI files, please go to http://www.edidev.com/menudownload.htm

After reinstalling another version of FREDI, and then trying to run my application, I get the following error message, which was not happening before – “Attempted to read or write protected memory. This is often an indication that other memory is corrupt”.
This problem can be resolved by removing the Framework EDI reference in your program, then putting the reference back again, and then re-compiling your program.

Or if the problem is occurring in .NET, replace the following line
ediDocument.Set(ref oEdiDoc, new ediDocument());
to
oEdiDoc = new ediDocument();

If the error only occurs with a particular EDI file, try opening the file with the eFileManager or eAnalyzer utility, to help you troubleshoot the problematic EDI fle.

I have a trading partner that includes leading zeros in its group control number (GS06). Since this is a numeric data type element, the FREDI component validates it to be an invalid value. However, our system can accept leading zeros for the group control number, and would like to set the FREDI component not to reject the EDI file for this particular error.
There are a couple options to handle this issue. The best way is to simply set the AcceptGroupWithErrors method of the ediAcknowledment object to “true”. E.g.

oAck. AcceptGroupWithErrors = true

This will generate a 997 EDI file reporting errors found in the group (GS) segment, but would specify that the received EDI file was still accepted.

The other option, which is not recommended because it goes against the standard, is to edit the SEF file and change the data type of the GS06 (data element 28) from numeric to alphanumeric. The steps are:

1. Open the SEF file with the SEF Manager utility, and locate data element 28 (Group Control Number) in the Data Element Directory (.ELMS)
2. Right click on the element, and change the data type from N0 to AN.

Also in your program (for later versions of FREDI) you would have to disable the option of using the built in Control Segments, but use the control segments in the SEF file instead by doing the following:

Set oSchemas = oEdiDoc.GetSchemas
oSchemas.Option(OptSchemas_UseBuiltInCtrlSegs) = 0


Is it possible to load a SEF as a string into the component?
Yes. To load a SEF string into the component, do the following

Set oSchema = oEdiDoc.LoadSchema("850_4010UniqueNameforCollection", Schema_Standard_Exchange_Format_Buffer)

oSchema.PutSchemaString sSefString



VB6 example program that loads a SEF string


I've created a web service application using the FREDI .NET hybrid component to process EDI files, but I'm finding that the performance is so much slower than other applications I've created with the FREDI .NET component. Any ideas? (webservices, aspx)
Unfortunately, this degradation is due to the FREDI .NET component being a hybrid meaning it is a managed code wrapper around the FREDI COM coponent. Web services run in multi-threaded apartments (MTA) while the FREDI .NET hybrid component, because of its reliance on its COM components, can only execute in single-threaded apartment (STA) Communication between the MTA and STA is the cause of the degradation.

For more details and solution on running COM components in web services, please see:

http://msdn.microsoft.com/en-us/magazine/cc163544.aspx

http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/



What does this error mean, and how do you resolve it? [DESCRIPTION:Terminator characters present in data. Release indicator not specified][CODE:12378]
In the X12 standard, this error occurs if your data consists of a character (or string) that is similar to a character (or string) already being used as a terminator. This is not allowed in the X12 standard. So the only resolution to the problem is to remove the conflicting character (or string) from your data before you map it to the FREDI component.

In the UN/EDIFACT standard, this error occurs if your data consists of a character (or string) that is similar to a character (or string) already being used as a terminator, but you have not specified a release indicator. To resolve this problem, simply specify a release indicator e.g.

oEdiDoc.ReleaseIndicator = "?"

The FREDI component will automatically add the release indicator character before the beginning of any conflicting character in your data.


I’m receiving WARNING messages when I’m validating my EDI files. How serious are these errors?
The FREDI component does not have a scale of how serious an error is. Warning messages occur when there is a discrepancy between the EDI file and SEF file. Any discrepancy would denote that the EDI file is not in compliance to the guideline specified in the SEF file.

Code snippet in C# to execute the FREDI runtime using process class.
(User contribution)

--- code snippet ---

string frEDILicenseKey = “11111222223333344444”;

string frEDIRuntimeEXE = AppDomain.CurrentDomain.BaseDirectory +

"Edidev_FREDI_Runtime.exe";

Process frEDIProcess = new Process();

frEDIProcess.StartInfo.FileName = frEDIRuntimeEXE;

frEDIProcess.StartInfo.Arguments = "-s" + frEDILicenseKey;

frEDIProcess.Start();

frEDIProcess.WaitForExit();

--- end of snippet ---



How do I create a setup installer in .NET for deployment to include the FREDI runtime license with my application?
1. Start a New Project in Visual Studio .NET
2. Select Setup and Deployment Project, and highlight Setup Wizard
3. Enter the name and location of where you want to create your setup program
4. Click OK
5. In Setup Wizard, select only option "Create a Setup for Windows Application"
6. Click Next
7. In the "Choose files to include" box, add the following
- Your program
- All necessary SEF files
- Edidev_FREDI_runtime.exe

8. Click Finish
9. From the IDE, select Custom Action Editor
10. Under Custom Actions, right click on the Install folder
11. Select Add Custom Action
12. In the File System item box, double click on "Application Folder"
13. Click on the "Add File" button, and add Edidev_FREDI_Runtime.exe file.
14. Highlight the Edidev_FREDI_Runtime.exe file
15. In the properties box, edit the Arguments field to add the serial number and path using the following syntax:

-s[serial number] -p[Path target folder]

e.g. -sQWO033PTHCBG -p"Program Files\MyAppFolder"

16. Save and recompile the program.

I’m having problems translating an EDI X12 945 file (version 5010) specifically around the LX loop. When an EDI 945 file has several instances of the LX loop (ID 0300), all instances other than the first are getting read at the sub LX loop (ID 0340). See attached example of EDI 945 file and SEF file.
This problem is caused by the LX sub loop 0340 in between the LS and LE segments. The FREDI component is interpreting the LS and LE segments as regular data segments - and not as indicators of a start and end of a loop.

If you’re trading partner does not use this loop (0340), then a simple fix to this problem is to delete the entire LX sub loop (0340) from the SEF file with the SEF Manager (right-click on the loop node 0340, then select “Remove Loop” from the action box.) See attached 945_005010_mod.SEF.

If the LX sub loop (0340) is being used in your guideline, then for the FREDI component to support this sub loop, you would have to modify the SEF file so that the LS segment is defined as a loop.

For example, instead of….

+LS
-LOOP – 340
+ LX
+N9

+LE

……it becomes:

-LOOP – LS
+ LS
- LOOP – 340
+ LX
+ N9

+LE

See attached 945_005010_mod2.SEF.

Sample X12 945 5010 EDI file and SEF file


  Home

  Evaluate Framework EDI

  Source Code Examples

  Purchase

  Support

  About EDIdEv LLC

EDIdEv - EDI Development
www.edidev.com