PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • 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
  • Deployment
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
AS/400: Development method
Overview
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 files.
  2. Creating the application (RAD) and programming.
  3. Creating the executable (WINDEV and WINDEV Mobile).
  4. Deployment.
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 files and creates a data referential for the 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 the files according to the definition of the keys. The integrity constraints defined for the AS/400 are retrieved.
To import the DDS:
  1. Select "Structure of files .. Import descriptions of files/tables". 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.On the "Analysis" pane, in the "Creation" group, expand "Import" and select "Import the descriptions of files/tables". 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 the name of the AS/400, the name of the profile 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.
Note: Extended information is automatically retrieved when the AS/400 files are imported into the analysis.

Exporting the DDS

If you want to create new files on the AS/400:
  1. Define the new files in the data model editor.
  2. Export the DDS to the AS/400 ("Structure of files .. Synchronize an AS/400 - iSeries (DDS and data)").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 files to export. For each selected 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.
Note: 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 files was imported into the analysis.
  • To modify some parameters of this connection (the user name or the password for example), use a Connection variable.
Note: 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 the 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 the last ASCallRtv command.
ASExecCalls all the AS/400 commands in command line, in the context of the 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 ("Wizard .. Generate 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:
  • WINDEVWindows "Workshop .. Executable .. Generate the Windows executable".
  • WINDEVLinux "Workshop .. Executable .. Generate the Linux executable".
  • Windows Mobile "Workshop .. Generate the Windows CE/Mobile application".
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".

Deployment

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