AS400 Interface - Beta Version 1.01

Introduction

Whilst looking for a PC to AS400 interface that we could use in Delphi we evaluated three 'off-the-shelf' products, two of which accessed the AS400 via the PC support DLL's and one that used an ODBC interface.

We found that the ODBC interface was too slow for our requirements, and the two DLL interfaces were not able to meet our requirements.

The solution was to write our own in-house interface which is completely native to Delphi.  We created four Delphi components:

AS400RemoteCommand      This allows any valid remote command to be submitted to
                       the AS400.

AS400DirectTransfer     This allows data to be read from or written to the AS400, it is
                       fully complient with the IBM PC support SQL interface and
                       provides optimum performance.

AS400DataAwareGrid      This is a local tool that enables data to be automatically loaded
                       and formatted directly into a grid.  The reasoning behind this
                       component is that when accessing data from the AS400 you
                       will either interperet each line as it arrives, place it directly in
                       a local PC based file, or want to load all the data into memory.
                       The Delphi string grid is the only component that allows large
                       amounts of data to be stored in memory.  Therefore we created
                       this hybrid string grid which will load an entire library member
                       and format it using the AS400 field names and data sizes.

AS400FileTransfer       This is another local tool that will receive data from the AS400
                       and create a local file that can then be accessed as a normal
                       text file.

The above components are avaliable either on a one-off or per site basis.  For evaluation purposes you may use the enclosed AS400RemoteCommand component.  If you require any further information or wish to evaluate or purchase any of the
above components then please contact us through our Compuserve address 100347,443.

Liability

To the maximum extent permitted by applicable law, Gerald Limited shall not be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other loss) arising out of the use or miuse of this product.  This product will be used in the full knowledge that it is a beta test version, and it is the responsibility of those reading this liability notice to ensure that nobody uses this product without full knowledge of this liability notice.

Trademarks

All trademarks are acknowledged

Copyright

This product is copyright Gerald Limited - all rights reserved.



System Requirements

The system requires PC support and all associated DLL's are present on your system (usually in the windows system directory), and a copy of Borlands Delphi is installed on your system.

Correspondence

All correspondence is to be sent via our Compuserve address 100347,443, our postal address is:

Gerald Limited
Systems Department
Europe House
World Trade Centre
London
England
E1 9AA

Test Platforms

This product has been tested on PC Support version 2.3, EICON LAN Router/400 and Novell  SAA400 Version 1.3b.

The Beta Test Package

For this beta test version, and to help us establish the level of interest in this product we have supplied just one of the components mentioned in the introduction, that is the Remote Command interface.

Installation

Create a new directory for the components to be installed in (I recommend a directory off your Delphi directory) and unzip the AS400.ZIP file into this directory.

Startup Delphi and do the following:

       1.      Go to the options menu and select the Install Components option

       2.      From the pop-up window select the ADD button

       3.      Another window will appear, select the BROWSE button

       4.      A file window will appear, select the file type DCU and change to
               the directory you created above

       5.      Select the file marked AS400SR.DCU

Once the component has been installed a new component tab called AS400 Controls will appear, this is where the Remote Command component is installed.


AS400RemoteCommand - Properties

Following is a list of AS400RemoteCommand properties (ie, avaliable at both run-time and design-time).

Command

       This is where you enter the command to execute on the AS400 and is any valid AS400 command for example:

                       SNDMSG MSG('Hello World') TOUSR(QSYSOPR)

Connected

       This is a boolean value which will be FALSE if no active conversation exists between the PC and the AS400.
       When an active conversation exists this value will be TRUE, setting it to FALSE will result in the active
       converstion with the AS400 being terminated.

ExecuteCommand

       This is a boolean value which will always be FALSE when interrogated.  To start a conversation with the
       AS400 and execute the command in the Command property you need to set this property to TRUE.  Once
       the command has been executed this value will automatically return to FALSE.

Name

       This is the component name and can be any valid Delphi name.

Reply

       Once a command has been executed this property, which is a string list, will contain the response from the
       AS400.  It is worth noting that the string list will not be created, and therefore unreadable, until a command has
       been executed.

ReturnCode

       This is the code that is returned by the AS400.  0 means a successful operation, see the section on Error Codes
       for a full list.

SystemName

       This is the name of the system to connect to.  If left blank (the default) then the default system will be connected
       to.  It should be noted that the system specified here must be connected to prior to executing any commands.


AS400RemoteCommand - Methods

Following is a list of AS400RemoteCommand methods (ie, only avaliable at run-time).

ExecRemoteCommand(Statement: String)

       This method can be used at run-time in place of setting the Command and ExecuteCommand properties.  It
       will start a conversation with the AS400 and send the command specified.  For example:

               ExecRemoteCommand('SNDMSG MSG(''Hello''') TOUSR(QSYSOPR)');

Disconnect: Integer

       This method will end the conversation with the AS400, just as if the Connected property is set to FALSE.
       It will return a value of 0 if successful.      For example:

               If Disconnet<>0 then
               begin

                       (* An error occured *)

               end;



AS400RemoteCommand

Hex Code                Cause

0000                    Command completed successfully
000A                    Warning issued
0014                    Error found
0032                    Contact ended with remote system
0033                    Conversation ended unexpectedly
0036                    Remote system name not found
0046                    Router is not loaded