× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I did have a program that parsed through an ASCII stream file, but it got deleted when I discontinued my membership at NETSHARE400.COM.  What you need to do though is find out how he is going to send the data.  Here is an example of how I was receiving info in an email:
 
Customer:Aaron Bartell
OrderNumber:1234
ItemOrdered:Toilet Paper
QtyOfItem:2
CreditCardNo:1234 5678 8909 1234
CreditCardExpMMYY:0502
etc . . .
 
Since I new that each order would start with a customer I would search for 'Customer' and start filling an array with all of the information that followed and then when I found field 'Customer' again I new that it was a new order.  Actually now that I think about that some more I think I searched for the colon that separated the data from the descriptor.  And then when I found a colon I would search back until I found a space and then I knew I had my field. 
 
Basically you are going to want to buff up on your SUBST and SCAN BIF's otherwise it is easy to get lost. 
 
Aaron Bartell
PS. I just talked to another guy in our group that has his own 400 and asked him if I had copied the email parsing program there, but right now he doesn't have access to the box to check; so I will keep you posted if I find it.
 
-----Original Message-----
From: tomh@simas.com [mailto:tomh@simas.com]
Sent: Wednesday, March 14, 2001 6:36 AM
To: RPG400-L@midrange.com
Subject: RE: RPG CGI


The boss was pitching an idea to the customer, the idea being that he (the customer) could send us the file in either of two ways: 1) as an attached Excel spreadsheet, and/or 2) as an email message.  

I was finally able to convince him that a better file format would be ASCII text, comma-delimited so that we could do just as you suggest - FTP the file into our databases (incidentally, this is exactly what we do for other stuff).

I have a feeling, though, that the email option will remain.  Having said that - do you have an RPGLE example or two of how to read thru an email?



"Bartell, Aaron L. (TC)" <ALBartell@taylorcorp.com>
Sent by: owner-rpg400-l@midrange.com

03/13/01 05:46 PM
Please respond to RPG400-L

       
        To:        "'RPG400-L@midrange.com'" <RPG400-L@midrange.com>
        cc:        
        Subject:        RE: RPG CGI




If you  are going to use email, which isn't what I would call a reliable EDI method,  have them send the inventory update in an attached file and then read through  that for the particular items that you need to update.  This is just my  first thought.  I don't think one would want to parse through the  actual email including all of the header information.  Ask him if he has  the capability to FTP then you could just have him FTP to your machine and PUT a  file in the IFS that contains the inventory updates.
 
But to  answer you question in short, yes you can use the read() C API function in an  RPG pgm. 
 
Aaron  Bartell
-----Original Message-----
From: tomh@simas.com  [mailto:tomh@simas.com]
Sent: Tuesday, March 13, 2001 4:13  PM
To: rpg400-l@midrange.com
Subject: RPG  CGI



We use our 400 as an  SMTP and POP3 server. Can I use APIs to read thru the body of some emails,  extracting some information?  We have a customer who'd like to send us  inventory updates in an email.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.