I'm having a problem of not getting any data inside my other fex unless I assign defaults in the fextoinclude file.
Is this normal, or am I missing something?This message has been edited. Last edited by: Kerry,
WebFOCUS 7.6 Windows, All Outputs
January 11, 2013, 12:56 PM
Mighty Max
Something is not right. Are your two fex files in the same folder? An -INCLUDE basically appends the code into the calling fex. Below are two fex files. If you run fex1.fex you can see that you do not need a DEFAULT for &COUNTRY. Although having a DEFAULT does not hurt anything. The SET will takes precedent over the DEFAULT.
-* File fex1.fex
-SET &COUNTRY = 'ENGLAND';
-INCLUDE fex2.fex
-* File fex2.fex
TABLE FILE CAR
PRINT
COUNTRY
WHERE COUNTRY EQ '&COUNTRY';
END
Your code does work. In fact, expanding your code to replicate what I'm trying to do appears to be working too.
Something must be wrong in my other code that I'm going to have to figure out.
Just in case it helps anyone else, here is the expanded version of the code similar to what I'm attempting to do.
-* File fex1.fex
-SET &COUNTRY = 'ENGLAND';
-INCLUDE fex2.fex
TABLE FILE TEMP1
PRINT *
END
-* File fex2.fex
TABLE FILE CAR
PRINT
COUNTRY
WHERE COUNTRY EQ '&COUNTRY';
ON TABLE HOLD AS TEMP1
END
WebFOCUS 7.6 Windows, All Outputs
January 11, 2013, 02:45 PM
FrankDutch
The sequence is wrong
The part that does the reporting from the temp file should be at the end
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
January 11, 2013, 02:51 PM
Crymsyn
I am not sure if this is the reason why your first code wasn't working but WebFOCUS sometimes gets upset when you do not end a -SET with a ;
Also, I am not sure if you run reports without saving much but includes use the last saved version.
WF: 8201, OS: Windows, Output: HTML, PDF, Excel
January 11, 2013, 04:28 PM
benicely
Frank,
So you're saying that fex2.fex should do the reporting and not do a table hold with fex1.fex printing information about what is in the table hold? It is a fluke that this works as written?
Crymsyn,
Sorry my first post was wrong, I meant to type a semicolon at the end of my set statements. My code does have a semicolon, and it's not bringing back any results unless I have defaults in fex2.fex.
WebFOCUS 7.6 Windows, All Outputs
January 11, 2013, 04:47 PM
benicely
Sorry everyone, I figured it out. The database changed on me, so the variables were being passed to the other fex correctly. My table query in fex2 was executing correctly and getting no data. Since there was no data to print, it was correctly saying there were no rows returned. ;-)