Focal Point
Custom Condition in Process Flow

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/299106644

May 20, 2010, 10:22 AM
Tasha
Custom Condition in Process Flow
ALL,

I have a simple CAR DM job for testing purposes to test whether I can create a custom condition based on a global variable with an RPC. The first part of the Process flow is the Data Flow that just loads CAR into a SQL table. Then there is a simple RPC, see below:

-SET &ECHO=ALL;

TABLE FILE CAR_SQL
SUM CNT.CAR
WHERE CAR EQ 'JAGUAR'
ON TABLE HOLD AS CM FORMAT ALPHA
END
-RUN
-READ CM &&JAGCNT.I5.

-RUN

-TYPE &&JAGCNT

-SET &&RPCCOND= IF &&JAGCNT EQ 0 THEN 0 ELSE 1234 ;

-TYPE &&RPCCOND

END

After this, I have a custom condition on the RPC to determine the path the flow takes afterwards. The custom condition is either (&&RPCCOND EQ 0) or (&&RPCCOND NE 0). The RPC passes the correct value to RPCCOND correctly when you run the RPC by itself. However when you run the entire process flow it always passes blanks which in return always gets determined as EQ 0 (True) value. After the condition, I just have 2 Email Notifications right now for testing purposes. The code built by the DMC from my custom conditions are below:

-IF (&&RPCCOND EQ 0) GOTO Big GrinEP_0;
-IF (&&RPCCOND NE 0) GOTO Big GrinEP_1;

DEP_0 and DEP_1 are these email notifications. Any ideas???

--Tasha


WebFocus 7.6.10
Data Migrator 7.6.10
Windows NT
Excel, PDF, HTML, AHTML
May 20, 2010, 10:22 AM
Tasha
Our WebFOCUS is 7.6.10 now. I need to change my information. Just FYI.


WebFocus 7.6.10
Data Migrator 7.6.10
Windows NT
Excel, PDF, HTML, AHTML
May 20, 2010, 11:22 AM
Dan Satchell
Remove the unnecessary END statement at the bottom of your RPC and see if that makes a difference.


WebFOCUS 7.7.05
May 20, 2010, 11:52 AM
Tasha
Dan,

Didn't seem to change the outcome. Below is the log for that part of the process:

05/20/2010 10:51:14 DEP_2: procedure rpc_car_test started. baseapp car_sql 2010-05-03-19-39-13t3cp00000163_00000001
05/20/2010 10:51:14 TABLE FILE CAR_SQL baseapp car_sql 2010-05-03-19-39-13t3cp00000163_00000001
05/20/2010 10:51:14 SUM CNT.CAR baseapp car_sql 2010-05-03-19-39-13t3cp00000163_00000001
05/20/2010 10:51:14 WHERE CAR EQ 'JAGUAR' baseapp car_sql 2010-05-03-19-39-13t3cp00000163_00000001
05/20/2010 10:51:14 ON TABLE HOLD AS CM FORMAT ALPHA baseapp car_sql 2010-05-03-19-39-13t3cp00000163_00000001
05/20/2010 10:51:14 END baseapp car_sql 2010-05-03-19-39-13t3cp00000163_00000001
05/20/2010 10:51:14 -RUN baseapp car_sql 2010-05-03-19-39-13t3cp00000163_00000001
05/20/2010 10:51:14 0 NUMBER OF RECORDS IN TABLE= 1 LINES= 1 baseapp car_sql 2010-05-03-19-39-13t3cp00000163_00000001
05/20/2010 10:51:14 -READ CM &&JAGCNT.I5. baseapp car_sql 2010-05-03-19-39-13t3cp00000163_00000001
05/20/2010 10:51:14 -RUN baseapp car_sql 2010-05-03-19-39-13t3cp00000163_00000001
05/20/2010 10:51:14 -TYPE baseapp car_sql 2010-05-03-19-39-13t3cp00000163_00000001
05/20/2010 10:51:14 -SET &&RPCCOND= IF EQ 0 THEN 0 ELSE 1234 ; baseapp car_sql 2010-05-03-19-39-13t3cp00000163_00000001
05/20/2010 10:51:14 -TYPE 0 baseapp car_sql 2010-05-03-19-39-13t3cp00000163_00000001
05/20/2010 10:51:14 0 baseapp car_sql 2010-05-03-19-39-13t3cp00000163_00000001
05/20/2010 10:51:14 DEP_2 rpc_car_test Return Code = 0 baseapp car_sql 2010-05-03-19-39-13t3cp00000163_00000001
05/20/2010 10:51:15 DEP_0 EDAMAIL Return Code = 0 baseapp car_sql 2010-05-03-19-39-13t3cp00000163_00000001


WebFocus 7.6.10
Data Migrator 7.6.10
Windows NT
Excel, PDF, HTML, AHTML
May 20, 2010, 01:54 PM
dhagen
quote:
Originally posted by Tasha:
TABLE FILE CAR_SQL
SUM CNT.CAR
COMPUTE NOTHING/A10 = ' '; <== this one
WHERE CAR EQ 'JAGUAR'
ON TABLE HOLD AS CM FORMAT ALPHA
ON TABLE SET HOLDLIST PRINTONLY <== and this one
END


Add the two lines noted above. Just in case some settings change during the run time of the process flow.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
May 20, 2010, 02:04 PM
Tasha
dhagen - I made the changes you suggested and still get the same response.

-SET &&RPCCOND= IF EQ 0 THEN 0 ELSE 1234 ;
-TYPE 0

That is from the log. It should be 10 and then RPCCOND would be set to 1234.


WebFocus 7.6.10
Data Migrator 7.6.10
Windows NT
Excel, PDF, HTML, AHTML
May 20, 2010, 04:08 PM
Dan Satchell
First, I believe CNT may be generating I9 output instrad of I5. Changing your -READ to -READ CM &&JAGCNT.I9 may fix the problem.

TABLE FILE CAR_SQL
SUM CNT.CAR 
WHERE CAR EQ 'JAGUAR'
ON TABLE HOLD AS CM FORMAT ALPHA
END
-*
-RUN
-READ CM &&JAGCNT.I9.
-TYPE &&JAGCNT
-SET &&RPCCOND= IF &&JAGCNT EQ 0 THEN 0 ELSE 1234 ; 
-TYPE &&RPCCOND


However, if you only need to differentiate beteween a zero and a non-zero result, this may be an easier way:

TABLE FILE CAR_SQL
 COUNT CAR 
 WHERE CAR EQ 'JAGUAR';
 ON TABLE SAVE
END
-*
-RUN

-SET &&RPCCOND = IF &LINES EQ 0 THEN 0 ELSE 1234 ; 
or more simply:
-SET &&RPCCOND = &LINES ;

-TYPE &&RPCCOND



WebFOCUS 7.7.05
May 20, 2010, 04:50 PM
Tasha
Dan - You were right about the I9. That fixed it, which is weird because the FF on the HOLD file showed I5. Thanks!

Also, I have to keep this scenario because I am right now just testing this theory for functionality. Eventually, I will need this for a comparison on dates.

Thanks for all the help.

-Tasha


WebFocus 7.6.10
Data Migrator 7.6.10
Windows NT
Excel, PDF, HTML, AHTML