As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I read the Language code from a ON TABLE HOLD command and I also verified the value in the variable using -TYPE command. Irrespective of the value in the variable, the ENG_RPT fex is the one that executes always. Even if the language code is FR for French, the English version executes. The control does not go to the FR_RPT label at all, no matter what the value of the &LANG_CDE variable is!
I am not sure what I am doing wrong here - am I using labels or -INCLUDE incorrectly?
Thanks in advance for all your help!This message has been edited. Last edited by: Nova27,
Tried changing the name of the label for EXIT, but that doesn't help.. I don't think this has anything to do with the label name...
Basically, when the language code is FR it still does not go to the label meant for executing the French version of the report.. It just goes to the Eng report label...
I am not sure why the control won't go to the French report label like it is supposed to!!?
TABLE FILE T_CAN_CDE_CNDCT_BOX_1
PRINT
LANG_CDE
WHERE MER_NUM EQ 8029283432
ON TABLE HOLD
END
-RUN
0 NUMBER OF RECORDS IN TABLE= 24 LINES= 24
-READ HOLD &LANGCDE.A4.
-TYPE ##AFTER_READ = FR
##AFTER_READ = FR
-IF FR EQ FR THEN GOTO FR_PDF ELSE GOTO ENG_PDF;
-ENG_PDF
-TYPE ##INSIDE_ENG_LABEL = FR
##INSIDE_ENG_LABEL = FR
-*-INCLUDE app/disclosurepacket.fex
-GOTO XEXIT
-XEXIT
-EXIT
This is part of the result of SET &ECHO=ALL
Here, in the READ statement - I am reading the language code. It is FR in this case. Then I just used TYPE to check my value after READ. The IF statement also replaces &LANGCDE with FR (as expected) and the test is true for FR EQ FR so it should go to the FR_PDF label, but instead it goes to the ENG_PDF label
And I have a TYPE inside the ENG_PDF label to see what the value is for &LANGCDE, which it says is FR.. I just don't know why it won't go to the FR_PDF label
Could it be caused by the A4 size of the &LANG_CDE? I mean maybe your if test is 'FR ' EQ 'FR' which will not be true. Try LTRIM(&LANG_CDE) to get rid of any spaces.
WebFOCUS 8206, Unix, Windows
Posts: 1853 | Location: New York City | Registered: December 30, 2015
IF LTRIM(&LANG_CDE) EQ 'FR' THEN GOTO FR_RPT ELSE GOTO ENG_RPT;
This doesn't work with -IF statement, throws an error - I tried earlier.
Anyway, the LTRIM idea is good.. I converted my TABLE FILE statement to a SQL query where I use LTRIM and now the logic works just fine... It is strange how I couldn't trim the LANG_CDE field when I read it from my master file!!
test the size of your &variable -SET &LANGCDE = TRUNCATE(&LANGCDE); -TYPE length: &LANGCDE.LENGTH I use something like Martin's idea: -SET &cmt_fr = IF &LANGCDE.QUOTEDSTRING EQ 'FR' THEN '' ELSE '-*'; -SET &cmt_en = IF &cmt_fr.QUOTEDSTRING EQ '-*' THEN '' ELSE '-*' &cmt_fr.EVAL-INCLUDE app/frrpt.fex &cmt_en.EVAL-INCLUDE app/engrpt.fex
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
No matter how you perform and call your INCLUDE (using my version, Babak or Susannah) all your problem is related to you &LANGCDE variable.
One thing you can try to prove that is the following:
TABLE FILE T_CAN_CDE_CNDCT_BOX_1
PRINT LANG_CDE
WHERE MER_NUM EQ 8029283432
ON TABLE HOLD
END
-RUN
-DEFAULTH &LANG_CDE = ''
-READFILE HOLD
-TYPE ##AFTER_READ = -&LANG_CDE-
-IF &LANG_CDE NE 'FR' THEN GOTO ENG_PDF ELSE GOTO FR_PDF;
-FR_PDF
-TYPE ##INSIDE_FR_LABEL = -&LANG_CDE-
-GOTO XEXIT
-ENG_PDF
-TYPE ##INSIDE_ENG_LABEL = -&LANG_CDE-
-GOTO XEXIT
-XEXIT
-EXIT
First I use READFILE instead of READ. That way you don't bother for format. Second I add dashes enclosing your variable. You will then see its real value (including spaces) Third I reversed the test just to see what will happen.
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
Thanks Martin - your way works as expected. I think using READFILE made all the difference, don't need LTRIM anymore. The LANG_CDE variable spits out the value without any spaces.
I think since I was using READ and had to give it a format, that's where I was encountering issues with the extra spaces.
Thanks everyone once again for helping me out! Really appreciate it!
Also have to pay attention to your NLS setting (Client and Server). If you are sure that the language read will always come from your TABLE FILE... and only have FR and EN values, you are good to go.
But if you may use the IBIWF_language variable it may contains FC standing for French Canadian where FR is for French France. So you may need to test both FR and FC or have something such as (in a common profile) :
-DEFAULTH &LANG = '';
-SET &LANG = IF &LANG EQ 'FOC_NONE' OR '_FOC_NULL' OR '' THEN UPCASE(2, &IBIWF_language, 'A2') ELSE ⟨
-SET &LANG = IF &LANG CONTAINS 'FC' OR 'FR' THEN 'FR' ELSE ⟨
-SET &LANG = IF &LANG CONTAINS 'US' THEN 'EN' ELSE ⟨
and then use &LANG to identify the selected language.
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013