Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]GOTO labels not recognized

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]GOTO labels not recognized
 Login/Join
 
Platinum Member
posted
Hi
I am trying to implement a logic which seems hard to accomplish.

We have a procedure which creates files in a network location(example: Car sales for each country)
I am doing this using loops.Based on the number of lines i create a file with country in where condition.
After this i have to insert some ID and filename in a DB table(This has to run for each loop)
After this another table has to be updated with complete status.

TABLE FILE CAR
BY COUNTRY
ON TABLE HOLD AS LOOP_CNT
END
-RUN
-TYPE &LINES
-SET &CNTR = &LINES;
-SET &FILENAME
-*************************************************************************************************************
-* LOOP Start
-*************************************************************************************************************
-REPEAT CAR_LOOP &LINES TIMES
-READFILE LOOP_CNT


-*************************************************************************************************************
-* Printing report for TYPE I
-*************************************************************************************************************

FILEDEF SAVEOUT DISK "LOCATION/&COUNTRY"
TABLE FILE CAR
SUM SALES
BY CAR
WHERE COUNTRY EQ '&COUNTRY';
ON TABLE SAVE AS SAVEOUT FORMAT PDF
END
-INCLUDE IBFS:/WFC/Repository/R/zz/Insert_Multifile_Details.fex
-CAR_LOOP 

-GOTO LBL_UPDATE

-LBL_UPDATE
-INCLUDE IBFS:/WFC/Repository/R/zz/Update_Multifile_Summary.fex 
-EXIT


Insert_Multifile_Details.fex
-IF &ERRORCODE EQ 0 THEN GOTO :SUCCESS ELSE GOTO :ERROR

-:SUCCESS


ENGINE SQLORA SET DEFAULT_CONNECTION &CONNECTION
SQL SQLORA
INSERT INTO DETAILS (REQUEST_ID,FILE_PATH) VALUES ('&ID','&FILE_PATH')
END
-RUN





-:ERROR
-SET &FOC_ERR_MSG =  FEXERR(&ERRORCODE,'A72');

SQL SQLORA
INSERT INTO ERROR_LOG(ERROR_NO,ERROR_MSG,OBJECT_TYPE,INPUT_PARAMS,UNIQUE_ID,APP_ERROR,EXECUTED_ON) VALUES ('&FOCERRNUM','&FOC_ERR_MSG','&RPT_NAME',' ','&PPAK_SEQ_ID1',' ','&DATEDMtrYY');
END
-RUN
  


Update_Multifile_Summary.fex
ENGINE SQLORA SET DEFAULT_CONNECTION &CONNECTION
SQL SQLORA
UPDATE SUMMARY SET STATUS ='&STATUS',FILE_COUNT ='&CNTR' WHERE REQUEST_ID = '&ID'
END

-RUN
  


If i use GOTO labels inside the Include FEX and include labels from the main fex it is not recognizing it

My issue is that it goes to error section always.
Is there a way that i can tell webFOCUS to skip a section of code and proceed with the next.

This message has been edited. Last edited by: Siva1925,
 
Posts: 181 | Registered: October 25, 2017Report This Post
Virtuoso
posted Hide Post
Each label exist and recognized within its own fex only to avoid the fact that you try to branch to a label that may exist at several places.

Also &ERRORCODE exist in the main fex not in the sub (included) reason why you condition always branch to :ERROR

Try with the following. Also note the semicolon at the end of the IF statement
-* -------------------------------------------------------------
-* Fex : Main Fex
-* -------------------------------------------------------------
TABLE FILE CAR
BY COUNTRY
ON TABLE HOLD AS LOOP_CNT
END
-RUN
-TYPE &LINES
-SET &CNTR = &LINES;
-SET &FILENAME
-*************************************************************************************************************
-* LOOP Start
-*************************************************************************************************************
-REPEAT CAR_LOOP &LINES TIMES
-READFILE LOOP_CNT

-*************************************************************************************************************
-* Printing report for TYPE I
-*************************************************************************************************************
FILEDEF SAVEOUT DISK "LOCATION/&COUNTRY"
TABLE FILE CAR
SUM SALES
BY CAR
ON TABLE SAVE AS SAVEOUT FORMAT PDF
END
-RUN
-SET &RESULTCD = &ERRORCODE;

-INCLUDE IBFS:/WFC/Repository/R/zz/Insert_Multifile_Details.fex
-CAR_LOOP 

-INCLUDE IBFS:/WFC/Repository/R/zz/Update_Multifile_Summary.fex 
-EXIT

-* ------------------------------------------------------------
-* Fex : IBFS:/WFC/Repository/R/zz/Insert_Multifile_Details.fex
-* ------------------------------------------------------------
-IF &RESULTCD EQ 0 THEN GOTO :SUCCESS ELSE GOTO :ERROR;

-:SUCCESS
ENGINE SQLORA SET DEFAULT_CONNECTION &CONNECTION
SQL SQLORA
INSERT INTO DETAILS (REQUEST_ID,FILE_PATH) VALUES ('&ID','&FILE_PATH')
END
-RUN

-:ERROR
-SET &FOC_ERR_MSG =  FEXERR(&RESULTCD,'A72');

SQL SQLORA
INSERT INTO ERROR_LOG(ERROR_NO,ERROR_MSG,OBJECT_TYPE,INPUT_PARAMS,UNIQUE_ID,APP_ERROR,EXECUTED_ON) VALUES ('&FOCERRNUM','&FOC_ERR_MSG','&RPT_NAME',' ','&PPAK_SEQ_ID1',' ','&DATEDMtrYY');
END
-RUN

-* ------------------------------------------------------------
-* Fex : IBFS:/WFC/Repository/R/zz/Update_Multifile_Summary.fex 
-* ------------------------------------------------------------
ENGINE SQLORA SET DEFAULT_CONNECTION &CONNECTION
SQL SQLORA
UPDATE SUMMARY SET STATUS ='&STATUS',FILE_COUNT ='&CNTR' WHERE REQUEST_ID = '&ID'
END
-RUN


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, 2013Report This Post
Platinum Member
posted Hide Post
I got this working.
Added a label after SUCCESS block that has nothing.
 
Posts: 181 | Registered: October 25, 2017Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]GOTO labels not recognized

Copyright © 1996-2020 Information Builders