Interfacing to the Outside World

Although A-Shell is running on a Windows or Linux host computer, interfacing with the programs and data in those operating systems still require the efforts of a programmer or integrator to work out the details. So the following topics are covered less in the spirit of "how-to" and more in the spirit of "what-you-can-do," with suggestions on where to go for further "how-to" details.

Email

Emailing from A-Shell is possible using several different approaches. To send email directly, without any interactive human intervention, the best approach is to use the EMAILX utility, which is available for a modest license fee. You can also use the built-in subroutine TCPX to interface directly to your mail server. For additional information on email processes and options, see:

•   PDFX, the A-Shell PDF generation module that provides various email options

•   MX_MAPI

•   EMAILX

•   EMAILP

Web Pages

Making content available via web pages can be handled in at least two different ways. At the simplest level, you can add a couple of HTML statements to the start and end of any report and then view it via any browser, either by manually typing in the FILE://<filename> URL into the browser, or by launching it via the MX_SHELLEX function (under A-Shell/Windows or ATE), or via a terminal-emulator-specific escape sequence (under A-Shell/UNIX).

The minimum set of HTML statements needed at the start of a report file is the string "<HTML><BODY><PRE>" and the corresponding trailing command would be "</PRE></BODY></HTML>". You could accomplish this without any program modification by using the PREFIX and SUFFIX options in the printer init files (which see in this document), but you would then have to launch the browser manually. An even simpler solution (under A-Shell/Windows) is to print to a printer whose init file contains COMMAND=SBX:HTMLP. This will apply the HTML statements above and automatically launch the browser to view the file.

The approach above is only useful for local or directly connected users. To make content available via web pages to ordinary web browser users who have no other connection to your server, you can modify one or more programs to support a CGI interface.

SQL / ODBC

If your data is stored in ISAM PLUS files, you can purchase a third party ODBC driver from Easysoft Limited that allows you to query, read, and write your data using popular client data analysis tools (spreadsheets, report writers, etc.)

The Easysoft ODBC driver can also access non ISAM PLUS files, but you lose the ability of using indexes. (That is, you have to scan one file at a time, from start to finish.) In either case, you’ll need a the map layout of your data records in order to create a schema definition. If you didn’t write the application, contact your application supplier for assistance before purchasing an Easysoft license.

CSV (Comma Separated Values)

In many cases, the simplest way to make your data available for analysis by popular PC tools is to output it in CSV format. Although this is a programming task, it is a very simple one. To make it even simpler, ASB includes statements—primarily WRITECD—that further simplify the task of outputting comma delimited files. Such files can be transferred to a PC, if necessary, and then read directly by many popular PC data-analysis utilities such as Excel.

Many people instinctively shy away from this suggestion, either out of the belief that converting data files to CSV format is complex or that it would take a long time to run the conversion. Both of these beliefs are misguided. In all but the most extreme cases, a utility to create a CSV version of an existing data file should take only a short time to write and only a few seconds to run. It often takes longer for the utility program—such as Access or Excel—to launch than it does to create the CSV data.

See Also

•   AXL:  Input/output for spreadsheet files

•   HTTP:  Interfacing with web services

•   XMPP:  Jabber messaging

•   TCPX:  Interfacing via TCP connections,

•   FTP2:  Interfacing via FTP/SFTP file transfers