The Micro Focus Generator provides greater processing speed and a 98% level of compatibility with its predecessor, the FMP generator. The 98% compatibility level, while difficult to quantify, is intended to indicate that nearly all statements continue to execute exactly as before. There are some exceptions:
This topic describes such changes to the language, while the built-in structures are documented in the Help topic MFG Structures.
Enhancements to the language include the following:
% IF &A = 1 % &B = 2 % &C = 3 % &D = 4 % END
Then an "indentation decreased" error would have occurred on the line, % &D = 4.
With the MFG generator, as long as the indentation does not terminate the scope of the % IF by starting in a column equal to or less than the starting column of the % IF statement, then the code above is accepted and executed. The following variation will process with the effect shown:
% IF &A = 1 ABD % &C = 3 % &D = 4 DEF % END
The output is:
ABD DEF
The following are FMP/MFG compatibility issues. With the MFG:
The most common use of evaluation expressions is to construct variable names; this use is usually not affected.
Evaluation expressions that are affected and do not work with the MFG generator include those that introduce self-modifying logic, which is generally considered a bad practice anyway. In practically all cases, there is a more natural way to recode an expression that is much more readable and often will execute faster.
Another type of evaluation expression that is not supported under MFG are those that have unmatched quotes. You can replace these expressions with equivalents that do not use unmatched quotes. For example:
Replace this evaluation statement... | With... |
---|---|
% <&SQ&A&B>" | % <&SQ&A&B&SQ> |
% <%&CQ AT &HH+:&MN> PM" | % <%&CQ AT &HH+:&MN PM&CQ> |
$ISPEXEC( "VGET (SSMBPLAN", % ... "SSMJOB", % ... "SSMCLASS") PROFILE" )
Taking the extra quote out fixes the problem.
$ruleName [ ( argument1 [, argument2...] ) ] &functionName [ ( argument1 [, argument2...] ) ]
% SET CONTROL % SET DELIMITERS-OPTIONAL % SET DELIMITERS-REQUIRED % SET CONVERT-LOWER-CASE % SET PRESERVE-LOWER-CASE % SET AUXILIARY-INPUT % SET COUNT % SET NOCOUNT % SET STRICT-STRING-LIMIT % SET NO-STRICT-STRING-LIMIT % SET CONTROL-CARDS
% SET EVAL-BRACKETS % SET EVAL-BRACKETS-AUX % SET LEFT-MARGIN % SET RIGHT-MARGIN % SET WRITE-CONTROL-LIMIT
&APS-TARGET &APS-CICS-DISPATCH &APS-INPUT.
To define values you need, code assignment statements
MOVE &FLD1 % ... TO &FLD2
Instead, code S-COBOL continuation as follows:
MOVE &FLD1 ... TO &FLD2
% <&VARIABLE> % <&VARIABLE> statementblock % <&VARIABLE> statementblock % ELSE statementblock % <$RULE>"QUOTED EXPRESSION"
Example:
% &A = "$MY-MAC" <&A>(&ABC)
To fix this, code:
% &A = "MY-MAC" $<&A>(&ABC)
Example:
% WHILE &DEFINED (&APS-EPILOGUE) % SET EPILOGUE <&DEFVAL>
To fix this, code:
% WHILE &DEFINED (&APS-EPILOGUE) % SET EPILOGUE $<&SUBSTR(&DEFVAL,2)>
In this example, the second statement is not recognized as the value of &REMARKS, but is treated as a text line. All statements indented under it are parsed successively, possibly resulting in compile errors.
% &REMARKS = "% IF 0" <&REMARKS> THIS IS A COMMENT LINE.
To fix this, code the following, which causes the parser to generate an undetermined type 2 node and handle the "IF 0" evaluation correctly at run-time:
% &REMARKS = "IF 0" % <&REMARKS> THIS IS A COMMENT LINE.
% &<%&ARG = &QT&ARG3&DOS-SYS+-&ARG2+-&DEV+-S-&ARG1&QT>
To fix this, code:
% &<%&ARG> = <%&QT&ARG3&DOS-SYS+-&ARG2+-&DEV+-S-&ARG1&QT>
% &A = 12.34
% &A = <&SQ>:<%&ST-NAME><%&COBOL-LINE><&SQ>
To fix this, code:
% &A = <&SQ><%:&ST-NAME><%&COBOL-LINE><&SQ>
Or:
% &A = <%&SQ:&ST-NAME&COBOL-LINE&SQ>
Or:
% &COLON = ":" % &A = <&SQ><%&COLON><%&ST-NAME><%&COBOL-LINE><&SQ>
% ELSE IF &A = "ABC" OR &B = "DEF"
To fix this, code:
% ELSE % IF &A = "ABC" OR &B = "DEF"
&16+88 PF24 VALUE &SQ+<&SQ.
To fix this, code:
% &LEVAL = "<" &16+88 PF24 VALUE &SQ+&LEVAL+&SQ.
Or:
&16+88 PF24 VALUE "<".
The following are samples of syntax encountered in actual production rules which were presumably never executed because they are not compilable with the FMP generator, and are not supported in MFG.
Example:
$DBDC-GEN-MSG( "9080", "NOGEN", &EDIT-NAME) "01-99")
To fix this, change the right parenthesis following &EDIT-NAME to a comma. This appears to be a typographical error.
Example:
$GASCR+-SELECT = XXXXA-CONFIRM 01
This is an invalid syntax for a rule call and appears to be a typographical error.
Example:
% IF &T-CODE NOT DEFINED
To fix this, code:
% IF NOT &DEFINED(&T-CODE)