| |
2.A Converter Command
IWEB/WEBCOMPILE command
Convert&Compile an iWeb object (WEBCOMPILE)
This command copys a source member, converts it for iWeb and then prompts/runs the IBM compilation command. This command runs as a pre-compiler
and the resulting object will run in both 5250 and iWeb environment.
The final object will be:
- A program enabled to run in both 5250 and iWeb environment.
- If the program is invokated from the 5250 environment, the 5250 workstation will be used.
- If the program is invokated from the iWeb environment, iWeb API and HTTP will be used.
- A display enabled to run in both 5250 and iWeb environment. In that case XML documents are created for iWeb.
- A menu enabled to run in both 5250 and iWeb environment. In that case XML documents are created for iWeb.
Accordind to the object (or source) type a compilation occurs in a library or/and an XML document is created in /iwebdata/fmts/LIBNAME/DSPNAME or in /iwebdata/menus/LIBNAME/MNUNAME
You can install this command as a PDM user option called "IW" through the command IWEB/PDMOPT. Then use "IW" instead of the opt14 or opt15 for the displays, menus and programs you want to iWeb-convert and compile, because this command runs as a pre-compiler (iWeb-converts and prompts/runs the opt14/opt15 command).
In addition: All compilation parameters are memorised in order to be reused (by default) for any next time the same object is recompiled. (ie: memorised means filed to history)
| Keyword |
Description |
Choices |
Notes |
| TYPE |
Source or object type |
RPG, RPGLE, CLP, CLLE, SQLRPG, SQLRPGLE, RPT, DSPF, MNUDDS, *PGM, *MODULE, *DSPF, *MENU |
Required, Positional 1 |
| OBJ |
Object |
Qualified object name |
Required, Positional 2 |
| Qualifier 1: Object |
Name |
| Qualifier 2: Library |
Name, *CURLIB |
| SRCFILE |
Source file |
Qualified source file name |
Required, Positional 3 |
| Qualifier 1: Source file |
Name |
| Qualifier 2: Library |
Name |
| SRCMBR |
Source member |
Name, *OBJ |
Optional, Positional 4 |
| PROMPT |
Prompt compile command |
*YES, *NO |
Optional, Positional 5 |
Object type (TYPE) - Object or source type
- RPG, RPGLE, CLP, CLLE, SQLRPG, SQLRPGLE, RPT, *PGM (an ILE RPG or an ILE CL bound program)
- *MODULE (an ILE RPG or an ILE CL module)
- DSPF, *DSPF (a Display file)
- MNUDDS, *MENU (a Display file menu)
The programming language of the source is assumed from the source type of the source member. Source types supported are:
- RPG - Will cause command CRTBNDRPG to be executed (In between RPG3 are converted in RPG4 with the cmd CVTRPGSRC)
- RPGLE - Will cause command CRTBNDRPG or CRTRPGMOD to be executed
- CLP - Will cause command IWEB/WCRTBNDCL (Short CRTBNDCL command with BNDDIR parameter) to be executed
- CLLE - Will cause command IWEB/WCRTBNDCL (Short CRTBNDCL command with BNDDIR parameter) or CRTCLMOD to be executed
- SQLRPG - Will cause command CRTSQLRPGI to be executed (In between RPG3 are converted in RPG4 with the cmd CVTRPGSRC)
- SQLRPGLE - Will cause command CRTSQLRPGI to be executed
- RPT - Will cause command CRTBNDRPG to be executed (In between RPG3 are converted in RPG4 with the cmd CVTRPGSRC)
- DSPF - Will cause command CRTDSPF to be executed
The overall process is as follow:
- For a program or a module (source copy/conversion then compilation)
- The original source file member will be copied to another source file in QTEMP (CASE1) or, if specified (CASE2 - through the browser Wizard converter), in a target library. In any case, any /COPY source member will be explicitly included into that source. The name of the new source file will be QTEMP/WRPGLESRC - WCLLESRC or, in (CASE2 - through the browser Wizard converter), will be "Q" + the first 9 chars of the original source file name.
- This new source file will get added statements to enable execution in the iWEB mode. (in CASE1 the resulting source code will appear in a new source file: QTEMP/QWRPGLESRC - QWCLLESRC)
- The resulting source statements are the ones used to create the requested program or module.
- If the job is interactive, the compile command is prompted to the user. The user may stop the process by pressing F3.
- The compile command is executed and, if successful, filed to history.
- For a display file (compilation then conversion)
- If this compile was already successful, the compile command is retrieved from the history, otherwise it is dynamically created
- The display file is compiled
- If the compile is successful, its record formats are converted to XML in the IFS: /IWEBDATA/FMTS/libName/dspName/... and the create command is filed to history.
- For a menu (conversion)
- No compile takes place in this case. Instead command IWEB/CVTMNU is used to convert an existing menu to a iWEB graphical menu in XML in the IFS: /IWEBDATA/MENUS/libName/mnuName/...
- If this conversion was already successful, the conversion command is retrieved from the history, otherwise it is dynamically created
- If the conversion is successful, the menu conversion command is filed to history.
Object (OBJ) - Specifies the library name and object name for the object you are creating. The object name and library name must conform to OS/400 naming conventions. If no library is specified, the created objects are stored in the current library.
Nota: For programs, you can specify the original application library or a new "target library". The uses of a new "target library" can be usefull to differentiate a 5250-only environment and a 5250+iWeb environment.
In the case you use a new "target library", this library will then contain the converted version of the program needed at runtime for the iWeb environment. Therefore this "target library" will have to be at the top of the *LIBL for the application job - You can do so either with a JOBD or within a INLPGM attached to the USRPRF doing (or used for) the LOGIN
For display files and menus, specify always the original application library.
Nota: In any case, the *LIBL dynamicity for program, menu or display invocation is totally integrated for the iWeb environment as it is for the 5250 environment.
Source file (SRCFILE) - Specifies the name of the source file that contains the source member to be compiled and the library where the source file is stored.
Source member (SRCMBR) - Specifies the name of the member of the source file that contains the source specifications to be compiled.
*OBJ - Use the name specified for the OBJ parameter as the source file member name. The compiled object will have the same name as the source file member.
Prompt compile command (PROMPT) - Whether the generated compile command should be prompted to the user or not.
- If you specify PROMPT(*YES), the compile command is prompted only if running in interactive mode. It is not prompted if running in batch mode.
- If you specify PROMPT(*NO), the compile command is not prompted even when running in the interactive mode.
Examples for WEBCOMPILE
Example 1: Convert and compile a Display file
IWEB/WEBCOMPILE TYPE(DSPF)
OBJ(MYLIBOBJ/ABC)
SRCFILE(MYLIBSRC/QDDSSRC)
SRCMBR(*OBJ)
PROMPT(*YES)
This command iWeb-converts and compiles the source ABC to the library MYLIBOBJ. The source member has the same name as the object and the source file is MYLIBSRC/QRPGLESRC. The final object will be a display file enabled to run in both 5250 and iWeb environment. The iWeb-conversion creates an XML document for each record-format of the display file MYLIBOBJ/ABC in the IFS:
- /iwebdata/fmts/MYLIBOBJ/ABC/fmt1.xml
- /iwebdata/fmts/MYLIBOBJ/ABC/fmt2.xml
Example 2: Convert and compile an RPG program
IWEB/WEBCOMPILE TYPE(RPGLE)
OBJ(MYLIBOBJ/ABC)
SRCFILE(MYLIBSRC/QRPGLESRC)
SRCMBR(*OBJ)
PROMPT(*YES)
This command iWeb-converts and compiles the source ABC to the library MYLIBOBJ. The source member has the same name as the object and the source file is MYLIBSRC/QRPGLESRC. The final object will be a program enabled to run in both 5250 and iWeb environment.
Example 3: Convert a menu
IWEB/WEBCOMPILE TYPE(MNUDDS)
OBJ(MYLIBOBJ/ABC)
SRCFILE(MYLIBSRC/QDDSSRC)
SRCMBR(*OBJ)
PROMPT(*YES)
This command iWeb-converts the source ABC to the library MYLIBOBJ. The source member has the same name as the object and the source file is MYLIBSRC/QRPGLESRC. The final object will be a tree-menu enabled to run in the iWeb environment. The iWeb-conversion creates an XML document for the menu MYLIBOBJ/ABC in the IFS: /iwebdata/uim/MYLIBOBJ/ABC.xml
Error Messagges for WEBCOMPILE
*ESCAPE Messagges
- CPF2105
- Object &1 in &2 of type *&3 not found.
- CVT0105
- *&1 &2 NOT compiled in library &3.
- CVT0104
- *&1 &2 iWeb-converted and compiled in library &3.
| |
|