Home | Sign in | English UK
  • Overview
  • Project and analysis
  • Importing the DDS (Reverse engineering)
  • Exporting the DDS
  • Creating the application
  • Programming the access to the data
  • Specific programming
  • Creating the executable and deploying
  • Creating the executable
  • Deploying the application
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
AS/400: Development method
The Native AS/400 Access simplifies the access to the AS/400 data from your WINDEV, WEBDEV and WINDEV Mobile applications.
In development, the same method is used regardless of the product used.
In deployment, only the runtime platform changes: Windows with WINDEV, a browser with WEBDEV, a Smartphone or a mobile device with WINDEV Mobile.
This page presents the development method in several steps:
  1. Creating the project and the analysis: importing the structure of data files.
  2. Creating the application (RAD) and programming.
  3. Creating the executable (WINDEV and WINDEV Mobile).
  4. Deploying the application.
Project and analysis

Importing the DDS (Reverse engineering)

If an existing database exists on your AS/400 (or on the one of your client), all you have to do is import the DDS defined on the AS/400 into your product to exploit this data. The data remains on the AS/400. You have the ability to access the physical files, the logical files, like any application written in RPG (GAP) or in Cobol.
WINDEV automatically retrieves the structure of the data files and creates a data repository useful for development. The AS/400 controls are converted into the Windows format. The data remains in AS/400 format.
Each one of the logical files becomes a key for WINDEV (unique key or multiple key). WINDEV deduces the relationships between data files according to the definition of the keys. The integrity constraints defined for the AS/400 are retrieved.
To import the DDS:
  1. On the "Analysis" pane, in the "Creation" group, expand "Import" and select "Import file/table descriptions...". The wizard starts. An AS/400 connection is automatically created and associated with the files imported into the analysis. This connection will have to be used to handle the AS/400 data file by programming.
  2. In the different wizard screens, select:
    • Data source: external database.
    • The data in current format will be used by the application.
    • When selecting the source database, specify the "Native Access for AS/400" mode, the IP address or name of AS/400, the profile name and the associated password.
  3. Select the AS/400 objects to import and validate.
See the help file supplied with the Native AS/400 Access for more details.
Remark: Extended information is automatically retrieved when the AS/400 files are imported into the analysis.

Exporting the DDS

If you want to create new data files on the AS/400:
  1. Define the new data files in the data model editor.
  2. Export the DDS to the AS/400: on the "Analysis" pane, in the "Analysis" group, expand "Synchronization" and select "Synchronize an AS400 - iSeries (DDS and data)".
  3. In the wizard, select the structures of the data files to export. For each selected data file, the DDS are created and compiled on the AS/400 in the library of your choice (*LIBL). The PC controls are converted into the AS/400 format.
See the help file supplied with the Native AS/400 Access for more details.
Creating the application
Once the data files have been imported into the analysis, the WINDEV, WEBDEV or WINDEV Mobile application can be created. The RAD (Rapid Application Development) can also be used to create a full application in a few minutes.
The test of this application can be run immediately.
What happens on the AS/400 when a WINDEV, WEBDEV or WINDEV Mobile program is run?
A physical connection to a job on the AS/400 corresponds to each current WINDEV application. This job depends on the profile defined.
Remark: The RAD is used to quickly create an application but you also have the ability to create full applications in the editor directly. All the elements generated by RAD can be modified. All the WLanguage functions can be used in an application for the AS/400.

Programming the access to the data

1. Establishing the connection
  • To establish the connection to the AS/400 database, use HOpenConnection and specify the name of the connection to open. This name was defined when the structure of the data files was imported into the analysis.
  • To modify some parameters of this connection (the user name or password for example), use a Connection. variable.
Remark: If you try to read the data file directly (HReadFirst, ...), the connection associated with the file description in the analysis will be automatically opened.
2. Running queries
HExecuteQuery and HExecuteSQLQuery are used to run queries on the current database.
  • HExecuteQuery: is used to run a preset query with the query editor.
  • HExecuteSQLQuery: is used to run a query by specifying the SQL code of query and the name that will be assigned to this SQL code.
3. Retrieving the result
The result is browsed by the standard read functions: HReadFirst, HReadNext, HReadSeek, ...
4. Closing the connection
HCloseConnection is used to close the connection to the database when all necessary queries have been run.

Specific programming

The Native AS/400 Access enables you to develop applications in Client/Server mode of data and in Client/Server mode of processes. You have the ability to:
  • perform calls to batch or CL while passing parameters,
  • manage the DataQueues or DataAreas,
  • run AS/400 commands, ...
Some examples of specific functions (starting with AS):
ASRunRPCStarts the execution of an AS/400 program and returns parameters (values returned by the program, OutPut variables, like on the AS/400).
ASCallRtvRuns an AS/400 command that returns variables (RTVJOBA type).
ASRtvResultRetrieves the result of last ASCallRtv command.
ASExecCalls all the AS/400 commands in command line, in the context of current session, with the authenticated AS/400 user profile, as on a terminal in 5250 mode.
ASUserChanges the AS/400 user profile under which you are connected in order to start a session with different privileges.

See the help file supplied with the Native AS/400 Access for more details.
Creating the executable and deploying
WINDEVWindows Mobile

Creating the executable

The method for creating the executable is the same as the method for creating the executable of a WINDEV or WINDEV Mobile application via the wizard for executable creation: on the "Project" pane, in the "Generation" group, click "Generate".

Deploying the application

The application or the site is deployed via the setup generator of the product used.
Minimum version required
  • Version 14
This page is also available for…
Click [Add] to post a comment