You will find below the conditions to comply with in order to ensure compatibility between the C and the RPG generators for ADELIA programs.
The C generator does not generate non-Adelia programs (CLPs, RPGs, etc.).
Important note: If you are working with an AS/400 database and if the CLP files contain commands (CLRPFM, OVRDBF, etc.) affecting the files, you can rewrite the CLPs in Adelia language as a set of EXECUTE_CMD instructions containing the AS/400 commands.
By default, the CALL instruction calls the programs in local mode. It is however possible to call them using the AS/400 programs' synchronous mode (Remote Procedure Call).
The EXECUTE_CMD_38 instruction does not have any effect.
The EXECUTE_CMD instruction can be used to run an AS/400 or a PC command. The commands are run in asynchronous mode.
Note: You can use an EXECUTE_CMD instruction to call an "*.EXE" program.
The RETURN instruction has the same effect as the TERMINATE instruction. The FREE_PGM instruction has no effect.
Currently with the RPG generator, "A = B" (where A is an alphanumeric variable) is equivalent to:
- "MOVE_ON_LEFT B A" if B is alphanumeric.
- "MOVE_ON_RIGHT B A" if B is numeric.
With the C generator, this will be equivalent to:
- "A = *BLANK" followed by "MOVE_ON_LEFT B A" if B is alphanumeric.
- "A = *BLANK" followed by "MOVE_ON_RIGHT B A" if B is numeric.
With the RPG generator, if you assign a numeric variable with a negative value to an alphanumeric variable, the character on the right will be the EBCDIC D0, D1, ..., D9 code.
Example:
The number -234 returns the string "23M" (the EBCDIC code for "M" is D4).
With the C generator, the character on the right will be the ASCII code D0, D1, ..., D9 (which is different from the EBCDIC D0, ... , D9) .
The "SFTKY FieldName FunctionKey" instruction (where FunctionKey is optional) is not available for output fields.
The DUPLICATE instruction will have no effect. However, you will still be able to copy data in an entry field on a PC using the Copy/Paste functions.
The numeric variables cannot be defined over more than 15 digits.
The key field of direct access views must be a numeric field with at least 10 positions (0 decimals).
The value returned by *RECORD_NBR is, for Btrieve files, an address defined on 10 digits. The variables containing this value must therefore be defined on at least 10 positions (0 decimals).
The program objects' names will be determined by the layout codes and not by the IBM names.
Warning: This is particularly important when programs are called dynamically. In this case, you must assign the layout code to the variable instead of the IBM name.
Variables are compared using the ANSI order instead of the EBCDIC order.
When a Btrieve file's data is read by key, it is displayed in the ASCII order.
When an AS/400 file's data is read by key, it is displayed in the EBCDIC order.
Restrictions
Do not use the DISPLAY_FORMAT instruction in interactive programs' formats.
Do not use the *LINE_NO, *COLUMN_NO, *CURSOR_RECORD and *CURSOR_FIELD_POS.
Do not use reserved words that are related to program, file or screen data structures, except for the *USER and *PGM_NAME reserved words (in connection with an AS/400), and *RECORD_NBR.
Do not use SQL instructions (this will be possible later).
Do not use DUMP, INSERT or DISPLAY_FORMAT instructions.
Version 4 arrays are forbidden. However, standard Adelia arrays can be used.