Brian, here is a LIVE example:
-PROMPT &TRNTYP1.(OR(<ALL,FOC_NONE>,<Permanent Adopted,O010>,<Temporary Adopted,O011>,<Permanent Adjustments,O020>,<Temporary Adjustments,O021>)).Perm/Temp Budget.
-PROMPT &TRNTYP2.(OR(<ALL,FOC_NONE>,<Revisions,1>,<Flexibilities,2>,<Transfers,3>)).Select Budget Type.
-*******************************************************************************
-IF (&TRNTYP1 EQ FOC_NONE AND &TRNTYP2 EQ FOC_NONE) GOTO DO_OUTPUT;
-*********************************************************************************
-* All Single/Multiple TRNTYP1's AND Single/Multiple TRNTYP2's
-*********************************************************************************
-SET &BAD_SEL = &QT | 'XXXX' | &QT | ',' | &QT | 'XXX' | &QT ;
-SET &P_ADP_REV = &QT | 'BD01' | &QT | ',' | &QT | 'BD1' | &QT ;
-SET &P_ADJ_REV = &QT | 'BD02' | &QT | ',' | &QT | 'BD2' | &QT ;
-SET &P_ADJ_FLX = &QT | 'BFP' | &QT ;
-SET &P_ADJ_TRF = &QT | 'P01' | &QT | ',' |
- &QT | 'P02' | &QT | ',' |
- &QT | 'P03' | &QT | ',' |
- &QT | 'P22' | &QT | ',' |
- &QT | 'P23' | &QT | ',' |
- &QT | 'P24' | &QT | ',' |
- &QT | 'P25' | &QT | ',' |
- &QT | 'P26' | &QT | ',' |
- &QT | 'P27' | &QT | ',' |
- &QT | 'P51' | &QT | ',' |
- &QT | 'P52' | &QT | ',' |
- &QT | 'P60' | &QT | ',' |
- &QT | 'P70' | &QT | ',' |
- &QT | 'P80' | &QT ;
-SET &T_ADP_REV = &QT | 'BD03' | &QT | ',' | &QT | 'BD3' | &QT ;
-SET &T_ADJ_REV = &QT | 'BD04' | &QT | ',' | &QT | 'BD4' | &QT ;
-SET &T_ADJ_FLX = &QT | 'BFT' | &QT ;
-SET &T_ADJ_TRF = &QT | 'BT1' | &QT | ',' |
- &QT | 'BS1' | &QT | ',' |
- &QT | 'BS2' | &QT | ',' |
- &QT | 'T01' | &QT | ',' |
- &QT | 'T02' | &QT | ',' |
- &QT | 'T03' | &QT | ',' |
- &QT | 'T22' | &QT | ',' |
- &QT | 'T23' | &QT | ',' |
- &QT | 'T24' | &QT | ',' |
- &QT | 'T25' | &QT | ',' |
- &QT | 'T26' | &QT | ',' |
- &QT | 'T27' | &QT | ',' |
- &QT | 'T51' | &QT | ',' |
- &QT | 'T52' | &QT | ',' |
- &QT | 'T60' | &QT | ',' |
- &QT | 'T70' | &QT | ',' |
- &QT | 'T80' | &QT ;
-SET &XTYPE1 = IF &TRNTYP1 CONTAINS 'O010' THEN &QT | 'Y' | &QT ELSE &QT | 'N' | &QT;
-SET &XTYPE2 = IF &TRNTYP1 CONTAINS 'O020' THEN &QT | 'Y' | &QT ELSE &QT | 'N' | &QT;
-SET &XTYPE3 = IF &TRNTYP1 CONTAINS 'O011' THEN &QT | 'Y' | &QT ELSE &QT | 'N' | &QT;
-SET &XTYPE4 = IF &TRNTYP1 CONTAINS 'O021' THEN &QT | 'Y' | &QT ELSE &QT | 'N' | &QT;
-**************************************************************************
-* Permanent Adopted
-**************************************************************************
-SET &RULE_200 = ' ';
-SET &RULE_210 = ' ';
-SET &RULE_10 = IF &XTYPE1.EVAL EQ 'N' THEN ' ' ELSE
- IF (&XTYPE1.EVAL EQ 'Y') AND (&TRNTYP2.EVAL EQ FOC_NONE) THEN &P_ADP_REV ELSE
- IF (&XTYPE1.EVAL EQ 'Y') AND (&TRNTYP2.EVAL EQ '1') THEN &P_ADP_REV ELSE &BAD_SEL;
-**************************************************************************
-* Permanent Adjustments
-**************************************************************************
-SET &P_ADJ_ALL = IF &XTYPE2.EVAL EQ 'N' THEN ' ' ELSE
- IF (&XTYPE2.EVAL EQ 'Y') AND (&TRNTYP2.EVAL EQ FOC_NONE)
- THEN &P_ADJ_REV | ',' | &P_ADJ_FLX | ',' | &P_ADJ_TRF
- ELSE ' ';
-**************************************************************************
-IF &XTYPE2.EVAL EQ 'Y' AND &MULTI_TYP2.EVAL EQ 'Y' GOTO MULTI_O020;
-**************************************************************************
-SET &P_ADJ_1 = IF (&XTYPE2.EVAL EQ 'Y') AND (&TRNTYP2.EVAL EQ '1') AND (&MULTI_TYP2.EVAL EQ 'N')
- THEN &P_ADJ_REV
- ELSE ' ';
-SET &P_ADJ_2 = IF (&XTYPE2.EVAL EQ 'Y') AND (&TRNTYP2.EVAL EQ '2') AND (&MULTI_TYP2.EVAL EQ 'N')
- THEN &P_ADJ_FLX
- ELSE ' ';
-SET &P_ADJ_3 = IF (&XTYPE2.EVAL EQ 'Y') AND (&TRNTYP2.EVAL EQ '3') AND (&MULTI_TYP2.EVAL EQ 'N')
- THEN &P_ADJ_TRF
- ELSE ' ';
-SET &RULE_20 = &P_ADJ_ALL || &P_ADJ_1 || &P_ADJ_2 || &P_ADJ_3;
-***************************
-GOTO NEXT_O011
-***************************
-MULTI_O020
-SET &RULE_20 = IF (&XTYPE2.EVAL EQ 'Y') AND (&TRNTYP2 OMITS '1') AND (&MULTI_TYP2.EVAL EQ 'Y')
- THEN &P_ADJ_FLX | ',' | &P_ADJ_TRF
- ELSE
- IF (&XTYPE2.EVAL EQ 'Y') AND (&TRNTYP2 OMITS '2') AND (&MULTI_TYP2.EVAL EQ 'Y')
- THEN &P_ADJ_REV | ',' | &P_ADJ_TRF
- ELSE
- IF (&XTYPE2.EVAL EQ 'Y') AND (&TRNTYP2 OMITS '3') AND (&MULTI_TYP2.EVAL EQ 'Y')
- THEN &P_ADJ_REV | ',' | &P_ADJ_FLX
- ELSE &P_ADJ_REV | ',' | &P_ADJ_FLX | ',' | &P_ADJ_TRF;
-***************************
-NEXT_O011
-***************************
-**************************************************************************
-* Temporary Adopted
-**************************************************************************
-SET &RULE_11 = IF &XTYPE3.EVAL EQ 'N' THEN ' ' ELSE
- IF (&XTYPE3.EVAL EQ 'Y') AND (&TRNTYP2.EVAL EQ FOC_NONE) THEN &T_ADP_REV ELSE
- IF (&XTYPE3.EVAL EQ 'Y') AND (&TRNTYP2.EVAL EQ '1') THEN &T_ADP_REV ELSE &BAD_SEL;
-**************************************************************************
-* Temporary Adjustments
-**************************************************************************
-SET &T_ADJ_ALL = IF &XTYPE4.EVAL EQ 'N' THEN ' '
- ELSE
- IF (&XTYPE4.EVAL EQ 'Y') AND (&TRNTYP2.EVAL EQ FOC_NONE)
- THEN &T_ADJ_REV | ',' | &T_ADJ_FLX | ',' | &T_ADJ_TRF
- ELSE ' ';
-**************************************************************************
-IF (&XTYPE4.EVAL EQ 'Y') AND (&MULTI_TYP2.EVAL EQ 'Y') GOTO MULTI_O021;
-**************************************************************************
-SET &T_ADJ_1 = IF (&XTYPE4.EVAL EQ 'Y') AND (&TRNTYP2.EVAL EQ '1') AND (&MULTI_TYP2.EVAL EQ 'N')
- THEN &T_ADJ_REV
- ELSE ' ';
-SET &T_ADJ_2 = IF (&XTYPE4.EVAL EQ 'Y') AND (&TRNTYP2.EVAL EQ '2') AND (&MULTI_TYP2.EVAL EQ 'N')
- THEN &T_ADJ_FLX
- ELSE ' ';
-SET &T_ADJ_3 = IF (&XTYPE4.EVAL EQ 'Y') AND (&TRNTYP2.EVAL EQ '3') AND (&MULTI_TYP2.EVAL EQ 'N')
- THEN &T_ADJ_TRF
- ELSE ' ';
-SET &RULE_21 = &T_ADJ_ALL || &T_ADJ_1 || &T_ADJ_2 || &T_ADJ_3;
-***************************
-GOTO FINAL_SET
-***************************
-MULTI_O021
-SET &RULE_21 = IF (&XTYPE4.EVAL EQ 'Y') AND (&TRNTYP2 OMITS '1') AND (&MULTI_TYP2.EVAL EQ 'Y')
- THEN &T_ADJ_FLX | ',' | &T_ADJ_TRF
- ELSE
- IF (&XTYPE4.EVAL EQ 'Y') AND (&TRNTYP2 OMITS '2') AND (&MULTI_TYP2.EVAL EQ 'Y')
- THEN &T_ADJ_REV | ',' | &T_ADJ_TRF
- ELSE
- IF (&XTYPE4.EVAL EQ 'Y') AND (&TRNTYP2 OMITS '3') AND (&MULTI_TYP2.EVAL EQ 'Y')
- THEN &T_ADJ_REV | ',' | &T_ADJ_FLX
- ELSE &T_ADJ_REV | ',' | &T_ADJ_FLX | ',' | &T_ADJ_TRF;
-***************************
-FINAL_SET
-***************************
-SET &RULE_10X = IF &RULE_10 EQ ' ' THEN ' ' ELSE
- IF &RULE_20 NE ' ' THEN &RULE_10 | ',' ELSE
- IF &RULE_11 NE ' ' THEN &RULE_10 | ',' ELSE
- IF &RULE_21 NE ' ' THEN &RULE_10 | ',' ELSE &RULE_10;
-SET &RULE_20X = IF &RULE_20 EQ ' ' THEN ' ' ELSE
- IF &RULE_11 NE ' ' THEN &RULE_20 | ',' ELSE
- IF &RULE_21 NE ' ' THEN &RULE_20 | ',' ELSE &RULE_20;
-SET &RULE_11X = IF &RULE_11 EQ ' ' THEN ' ' ELSE
- IF &RULE_21 NE ' ' THEN &RULE_11 | ',' ELSE &RULE_11;
-SET &RULE_21X = IF &RULE_21 EQ ' ' THEN ' ' ELSE &RULE_21 ;
-**********************************************************
-SET &RULE_CLASS = '(' || &RULE_10X || &RULE_20X || &RULE_11X || &RULE_21X || ')';
-**********************************************************
-********************************************
WHERE RULE_CLASS IN &RULE_CLASS;
-********************************************
Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe