Article View: comp.protocols.misc
Article #1003Re: Free EDI
From: Joseph H Allen
Date: Sat, 22 Feb 1997 00:00
Date: Sat, 22 Feb 1997 00:00
173 lines
7774 bytes
7774 bytes
In article <phrE5zB8v.DJy@netcom.com>, Paul Rubin <phr@netcom.com> wrote:
>I continue to believe relational databases aren't a natural way to
>represent what goes into EDI documents.
Relational databases are a very general- any data structure can be mapped to
them (structures, lists, trees, even self-referential trees like grammars).
Most modern databases are relational: what more natural choice could there
be for transfering data between databases?
Well here's a revised example Free-EDI purchase order. I changed the
overall format so that long lines are broken by whitespace (if a line begins
with whitespace, it is a continuation of the previous line and the
whitespace is reduced to a single space, also whitespace around fields is
ignored). Thus a transaction can be formatted so as to be humanly readable.
Also I've added column and table descriptions and Mandatory/Optional
qualifiers for tables and columns. The idea is that you could have a
program which prompts a user for data given a copy of the standard or even
an instance of any transaction. Alternatively, there could be a program
which verifies syntax and ensures that mandatory data is really given.
Additional information could be given along with the column and table
definitions: column width, whether a column or set of columns must be
unique, range qualifiers for numeric types, whether a column is a code which
indexes another table and so on. It would be conceivable that database
consistency expressions could be specified as in some RDMSs, but I think
that would probably be a little over done. I was also thinking that it
would be neat if a transaction could survive being sorted by cleverly
ordering the line type characters. It would be possible, but is probably
not all that necessary.
I think this would be a vast improvement over the current EDI format. It's
self-documenting, humanly readable and requires only a single simple parser
which doesn't depend on the type of data being transmitted.
Still... if there is no real interest I'll drop the issue. There is already
a push for EDI over e-mail and UN/EDIFACT is publicly available- which were
my biggest complaints in the first place. Free-EDI won't help me in my job,
but I can always wish for a gnu world...
; Begin Free-EDI transactions. The following line tells where the mail
; header ends and our data begins. The first character of the line
; identifies the line type. Blank lines and lines beginning with ; are
; ignored.
beginning of Free-EDI data
; Free-EDI version number
v free-edi.1
; Begin transaction with unique transaction I.D.
x jhallen@world.std.com.1557736
; Tables which make up the transaction
; Header table
t header(m) Standard free-edi.1 transaction header table
; Column descriptions for header table
c date(date,m) Date transaction has been submitted.
c from(text,m) Sender's e-mail address.
c to(text,m) Recipient's e-mail address.
c form(text,m) Form identifier.
; Column ordering for header table '|' is field separator.
|date |from |to
|form
; Records which make up the table
|1997-02-18.04:30 |jhallen@world.std.com |free-edi@motorola.com
|Simple-Order-USA.1
; Orders table
t orders(m) A table of the orders being submitted by this transaction.
; Column descriptions
c refno(text,m) Identifies the order.
c billto(text,m) Identifies who is paying for the order. See the
addresses list which follows.
c shipto(text,m) A code for the address where the order is to be
shipped. See the addresses list which follows.
c placedby(text,o) Optional name of the person who is placing the order.
c paymethod(text,m) A code for the payment method to be used for this
order.
c shipvia(text,m) A code for the shipping method to be employed in
delivering this order.
c shipdate(date,o) Requested arrival date for this order.
; Column ordering
>refno |billto |shipto|placedby|paymeth|shipvia |shipdate
; Records
|1000 |joe |joe |joe |net30 |fedex-2 |1997-02-19
|1023 |joe |joe |joe |ccard |ups-blue |1997-02-19
t addresses(o) A list of addresses used throughout this order.
c addrcode(text,m) Code which identifies this address.
c name(text,m) Company name.
c street(text,m) Street.
c city(text,o) City.
c state(text,o) State.
c zipcode(text,m) Zip.
c contact(text,o) Contact.
c phone(text,o) Phone number.
; Column ordering
>addrid |name
|street
|city |state |zipcode
|contact |phone
; Records. Notice that they can be fairly free-form.
|joe |Joseph Allen
|53 Windor St.
|Hackensack |NJ |11359
|joe |567-133-1234
|pete |Pete Cronin
|125 Edwards ave.
|Plainfield |MA |01010
|pete |508-221-1122
t itemlines(m) A list of the items being ordered.
c refno(text,m) Code which identifies the order
c itemcode(text,m) Code which identifies item
c description(text,o) Description of item.
c qty(int,m) Quantity ordered.
>refno |itemcode|description |qty
|1000 |106041 |1 micron steal bearings |8000
|1002 |104008 |3" steel bearings |50
t shipvia(o) A list of possible shipping methods
c shipvia(text,m) Shipping code.
c description(text,o) Description of the shipping method.
>shipvia |description
|ups-red |Overnight with UPS
|ups-blue|2nd day UPS
|fedex-1 |Fedex priority
|fedex-2 |Fedex 2nd day
t paymeth(o) A list of possible payment methods
c paymeth(text,m) Code for the payment method.
c description(text,o) Description of payment method
c pono(text,o) Purchase order no.
c ccard(text,o) Credit card no.
>paymeth |description |pono |ccard
|net30 |Bill purchaser | |
|po |Use given PO number |123456 |
|ccard |Use this credit card | |1234123412341234 12/99
; End transaction with transaction I.D.
e jhallen@world.std.com.1557736
; End of all transactions
z
--
/* jhallen@world.std.com (192.74.137.5) */ /* Joseph H. Allen */
int a[1817];main(z,p,q,r){for(p=80;q+p-80;p-=2*a[p])for(z=9;z--;)q=3&(r=time(0)
+r*57)/7,q=q?q-1?q-2?1-p%79?-1:0:p%79-77?1:0:p<1659?79:0:p>158?-79:0,q?!a[p+q*2
]?a[p+=a[p+=q]=q]=q:0:0;for(;q++-1817;)printf(q%79?"%c":"%c\n"," #"[!a[q-1]]);}
Technical Details
Message-ID:
<E5zoHE.5Cr@world.std.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<E5v7qE.D85@world.std.com> <E5yrEv.4o2@bigbird.telly.org> <E5z5C3.JL1@world.std.com> <phrE5zB8v.DJy@netcom.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1103af,b5b6fb3cf8b99ab3 X-Google-Attributes: gid1103af,public X-Google-Thread: 1145cb,b5b6fb3cf8b99ab3 X-Google-Attributes: gid1145cb,public X-Google-Thread: 10963c,b5b6fb3cf8b99ab3 X-Google-Attributes: gid10963c,public X-Google-Thread: 1023f3,b5b6fb3cf8b99ab3 X-Google-Attributes: gid1023f3,public X-Google-Thread: fbe20,b5b6fb3cf8b99ab3 X-Google-Attributes: gidfbe20,public X-Google-Thread: 1025b4,b5b6fb3cf8b99ab3 X-Google-Attributes: gid1025b4,public X-Google-Thread: fc5c9,b5b6fb3cf8b99ab3 X-Google-Attributes: gidfc5c9,public From: jhallen@world.std.com (Joseph H Allen) Subject: Re: Free EDI Date: 1997/02/22 Message-ID: <E5zoHE.5Cr@world.std.com> X-Deja-AN: 220594776 References: <E5v7qE.D85@world.std.com> <E5yrEv.4o2@bigbird.telly.org> <E5z5C3.JL1@world.std.com> <phrE5zB8v.DJy@netcom.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.protocols.misc,gnu.misc.discuss,biz.comp.accounting,bit.listserv.edi-l,tnn.protocols.edi,comp.protocols.misc,comp.os.linux.misc,comp.databases,sci.crypt