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     Need to capture WF Errors

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Need to capture WF Errors
 Login/Join
 
Member
posted
I have the below code that loops through a list of flat file names and runs this code for each.

I'm trying to see if I have any errors with reading the flatfile with the metadata. For example from time to time a user will imput a delimiter causing a (FOC1271) and (FOC1049) error.

My issue is each time the &FOCERRNUM and &RETCODE show 0 for each run, giving the impression all is well when it's not.


-************** CODE START**********************
TABLE FILE STO_GET_FILENAME
PRINT
FOC_NAME
FOC_NAME_SAVE
ON TABLE HOLD AS STO_GET_FILENAME_USE
WHERE FOC_NAME CONTAINS '&CORRECT_PERIOD';
END
-RUN


-SET &NUMRECS = &LINES;
-*
-SET &I = 0;
-*
-STARTLOOP
-SET &I = &I + 1;
-READ STO_GET_FILENAME_USE NOCLOSE &LEVEL.&I.A25. &TYPE.&I.A25.
-*
-IF &IORETURN NE 0 GOTO ENDLOOP;
-*
-SET &TYPE_NEW = LJUST(25, &TYPE.&I, 'A25');
-SET &FOC_MAS_NAME = &TYPE.&I ;
-*
-SET &HOLD_LOOP = 'ON TABLE HOLD AS STO_ATT_LOG_LOOP FORMAT FOCUS INDEX HIT_STR';
-SET &FFILE_USE_1 = 'logs/' | &LEVEL.&I ;
-*
APP FI FF_ATT_LOG DISK &FFILE_USE_1
-*
TABLE FILE FF_ATT_LOG
PRINT
HIT_RPT
HIT_DTE
HIT_TME
HIT_DIV
HIT_REG
HIT_DST
HIT_STR
HIT_FLG
HIT_EID
&HOLD_LOOP
END

-SET &FOCERRMSG = FEXERR(&FOCERRNUM, 'A72');
-TYPE &FOCERRMSG
-TYPE FOCFOCEXEC: &FOCFOCEXEC
-TYPE FOCERRNUM: &FOCERRNUM
-TYPE RETCODE: &RETCODE
-TYPE ACCEPTS: &ACCEPTS
-TYPE FOCERRNUM: &FOCERRNUM
-TYPE Records: &RECORDS
-TYPE Lines: &LINES
-*-TYPE &FOCFEXNAME
-*-TYPE &FOCINCLUDE
-*-TYPE &FOCREL
-*-TYPE &FOCEXURL
-*-TYPE &READS
-*-TYPE &SETFILE
-RUN

-IF &I LT &NUMRECS GOTO STARTLOOP;
-ENDLOOP

-************** CODE END **********************


Loop one and two below look fine, but loop 3 is where it causes the error and doesn't return an error code?


-********** HTML OUTPUT START **************
TABLE FILE STO_GET_FILENAME
PRINT
FOC_NAME
FOC_NAME_SAVE
ON TABLE HOLD AS STO_GET_FILENAME_USE
WHERE FOC_NAME CONTAINS 'p1.txt';
END
-RUN
0 NUMBER OF RECORDS IN TABLE= 56 LINES= 56
-SET &NUMRECS = 56;
-*
-SET &I = 0;
-*
-STARTLOOP
-SET &I = 0 + 1;
-READ STO_GET_FILENAME_USE NOCLOSE &LEVEL1.A25. &TYPE1.A25.
-*
-IF 0 NE 0 GOTO ENDLOOP;
-*
-SET &TYPE_NEW = LJUST(25, att_rpt_log_10_p1 , 'A25');
-SET &FOC_MAS_NAME = att_rpt_log_10_p1 ;
-*-SET &SAVE_AS = 'AZ_IVR_' || &TYPE_NEW ;
-*-SET &TEST_HOLD1IVR_LOOP = 'ON TABLE HOLD AS ' | &SAVE_AS || ' FORMAT FOCUS INDEX STORE_NUMBER';
-*
-SET &HOLD_LOOP = 'ON TABLE HOLD AS STO_ATT_LOG_LOOP FORMAT FOCUS INDEX HIT_STR';
-SET &FFILE_USE_1 = 'logs/' | att_rpt_log_10_p1.txt ;
-*
APP FI FF_ATT_LOG DISK logs/att_rpt_log_10_p1.txt
-*
TABLE FILE FF_ATT_LOG
PRINT
HIT_RPT
HIT_DTE
HIT_TME
HIT_DIV
HIT_REG
HIT_DST
HIT_STR
HIT_FLG
HIT_EID
ON TABLE HOLD AS STO_ATT_LOG_LOOP FORMAT FOCUS INDEX HIT_STR
END
-SET &FOCERRMSG = FEXERR(0 , 'A72');
1
0 NUMBER OF RECORDS IN TABLE= 3284 LINES= 3284
0
-SET &FOCERRMSG = FEXERR(0 , 'A72');
-TYPE ERROR
ERROR
-TYPE FOCFOCEXEC: _dw_att_log.fex
FOCFOCEXEC: _dw_att_log.fex
-TYPE FOCERRNUM: 0
FOCERRNUM: 0
-TYPE RETCODE: 0
RETCODE: 0
-TYPE ACCEPTS: 3284
ACCEPTS: 3284
-TYPE FOCERRNUM: 0
FOCERRNUM: 0
-TYPE Records: 3284
Records: 3284
-TYPE Lines: 3284
Lines: 3284
-*-TYPE &FOCFEXNAME
-*-TYPE &FOCINCLUDE
-*-TYPE &FOCREL
-*-TYPE &FOCEXURL
-*-TYPE &READS
-*-TYPE &SETFILE
-RUN
-IF 1 LT 56 GOTO STARTLOOP;
-STARTLOOP
-SET &I = 1 + 1;
-READ STO_GET_FILENAME_USE NOCLOSE &LEVEL2.A25. &TYPE2.A25.
-*
-IF 0 NE 0 GOTO ENDLOOP;
-*
-SET &TYPE_NEW = LJUST(25, att_rpt_log_11_p1 , 'A25');
-SET &FOC_MAS_NAME = att_rpt_log_11_p1 ;
-*-SET &SAVE_AS = 'AZ_IVR_' || &TYPE_NEW ;
-*-SET &TEST_HOLD1IVR_LOOP = 'ON TABLE HOLD AS ' | &SAVE_AS || ' FORMAT FOCUS INDEX STORE_NUMBER';
-*
-SET &HOLD_LOOP = 'ON TABLE HOLD AS STO_ATT_LOG_LOOP FORMAT FOCUS INDEX HIT_STR';
-SET &FFILE_USE_1 = 'logs/' | att_rpt_log_11_p1.txt ;
-*
APP FI FF_ATT_LOG DISK logs/att_rpt_log_11_p1.txt
-*
TABLE FILE FF_ATT_LOG
PRINT
HIT_RPT
HIT_DTE
HIT_TME
HIT_DIV
HIT_REG
HIT_DST
HIT_STR
HIT_FLG
HIT_EID
ON TABLE HOLD AS STO_ATT_LOG_LOOP FORMAT FOCUS INDEX HIT_STR
END
-SET &FOCERRMSG = FEXERR(0 , 'A72');
1
0 NUMBER OF RECORDS IN TABLE= 3838 LINES= 3838
0
-SET &FOCERRMSG = FEXERR(0 , 'A72');
-TYPE ERROR
ERROR
-TYPE FOCFOCEXEC: _dw_att_log.fex
FOCFOCEXEC: _dw_att_log.fex
-TYPE FOCERRNUM: 0
FOCERRNUM: 0
-TYPE RETCODE: 0
RETCODE: 0
-TYPE ACCEPTS: 3838
ACCEPTS: 3838
-TYPE FOCERRNUM: 0
FOCERRNUM: 0
-TYPE Records: 3838
Records: 3838
-TYPE Lines: 3838
Lines: 3838
-*-TYPE &FOCFEXNAME
-*-TYPE &FOCINCLUDE
-*-TYPE &FOCREL
-*-TYPE &FOCEXURL
-*-TYPE &READS
-*-TYPE &SETFILE
-RUN
-IF 2 LT 56 GOTO STARTLOOP;
-STARTLOOP
-SET &I = 2 + 1;
-READ STO_GET_FILENAME_USE NOCLOSE &LEVEL3.A25. &TYPE3.A25.
-*
-IF 0 NE 0 GOTO ENDLOOP;
-*
-SET &TYPE_NEW = LJUST(25, att_rpt_log_12_p1 , 'A25');
-SET &FOC_MAS_NAME = att_rpt_log_12_p1 ;
-*-SET &SAVE_AS = 'AZ_IVR_' || &TYPE_NEW ;
-*-SET &TEST_HOLD1IVR_LOOP = 'ON TABLE HOLD AS ' | &SAVE_AS || ' FORMAT FOCUS INDEX STORE_NUMBER';
-*
-SET &HOLD_LOOP = 'ON TABLE HOLD AS STO_ATT_LOG_LOOP FORMAT FOCUS INDEX HIT_STR';
-SET &FFILE_USE_1 = 'logs/' | att_rpt_log_12_p1.txt ;
-*
APP FI FF_ATT_LOG DISK logs/att_rpt_log_12_p1.txt
-*
TABLE FILE FF_ATT_LOG
PRINT
HIT_RPT
HIT_DTE
HIT_TME
HIT_DIV
HIT_REG
HIT_DST
HIT_STR
HIT_FLG
HIT_EID
ON TABLE HOLD AS STO_ATT_LOG_LOOP FORMAT FOCUS INDEX HIT_STR
END
-SET &FOCERRMSG = FEXERR(0 , 'A72');
(FOC1271) DFIX: RECORD # 2440. FIELD 'HIT_FLG' (# 9) IS TRUNCATED.
ORIGINAL LEN = 6
(FOC1049) ERROR IN READING NEXT RECORD : ff_att_log
1
0 NUMBER OF RECORDS IN TABLE= 2439 LINES= 2439
0
-SET &FOCERRMSG = FEXERR(0 , 'A72');
-TYPE ERROR
ERROR
-TYPE FOCFOCEXEC: _dw_att_log.fex
FOCFOCEXEC: _dw_att_log.fex
-TYPE FOCERRNUM: 0
FOCERRNUM: 0
-TYPE RETCODE: 0
RETCODE: 0
-TYPE ACCEPTS: 2439
ACCEPTS: 2439
-TYPE FOCERRNUM: 0
FOCERRNUM: 0
-TYPE Records: 2439
Records: 2439
-TYPE Lines: 2439
Lines: 2439
-*-TYPE &FOCFEXNAME
-*-TYPE &FOCINCLUDE
-*-TYPE &FOCREL
-*-TYPE &FOCEXURL
-*-TYPE &READS
-*-TYPE &SETFILE
-RUN
-IF 3 LT 56 GOTO STARTLOOP;

-********** HTML OUTPUT END **************

Thanks,
Todd


7.6.8
UNIX
FOCUS,HTML,PDF,EXCEL.
 
Posts: 18 | Registered: September 29, 2010Report This Post
Expert
posted Hide Post
In this type of situation - mixing FOCUS code and Dialogue Manager scripting, it is imperative to put a -RUN after each END command - the _RUN forces execution of the FOCUS code before the Dialogue Manager script gets evaluated.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
I made that change and below are the results, I didn't see a change in the error codes.

HTML OUTPUT:

TABLE FILE STO_GET_FILENAME
PRINT
FOC_NAME
FOC_NAME_SAVE
ON TABLE HOLD AS STO_GET_FILENAME_USE
WHERE FOC_NAME CONTAINS 'p1.txt';
END
-RUN
0 NUMBER OF RECORDS IN TABLE= 56 LINES= 56
-SET &NUMRECS = 56;
-*
-SET &I = 0;
-*
-STARTLOOP
-SET &I = 0 + 1;
-READ STO_GET_FILENAME_USE NOCLOSE &LEVEL1.A25. &TYPE1.A25.
-*
-IF 0 NE 0 GOTO ENDLOOP;
-*
-SET &TYPE_NEW = LJUST(25, att_rpt_log_10_p1 , 'A25');
-SET &FOC_MAS_NAME = att_rpt_log_10_p1 ;
-*
-SET &HOLD_LOOP = 'ON TABLE HOLD AS STO_ATT_LOG_LOOP FORMAT FOCUS INDEX HIT_STR';
-SET &FFILE_USE_1 = 'logs/' | att_rpt_log_10_p1.txt ;
-*
APP FI FF_ATT_LOG DISK logs/att_rpt_log_10_p1.txt
-*
TABLE FILE FF_ATT_LOG
PRINT
HIT_RPT
HIT_DTE
HIT_TME
HIT_DIV
HIT_REG
HIT_DST
HIT_STR
HIT_FLG
HIT_EID
ON TABLE HOLD AS STO_ATT_LOG_LOOP FORMAT FOCUS INDEX HIT_STR
END
-RUN
1
0 NUMBER OF RECORDS IN TABLE= 3450 LINES= 3450
0
-SET &FOCERRMSG = FEXERR(0 , 'A72');
-TYPE ERROR
ERROR
-TYPE FOCFOCEXEC: _dw_att_log.fex
FOCFOCEXEC: _dw_att_log.fex
-TYPE FOCERRNUM: 0
FOCERRNUM: 0
-TYPE RETCODE: 0
RETCODE: 0
-TYPE ACCEPTS: 3450
ACCEPTS: 3450
-TYPE FOCERRNUM: 0
FOCERRNUM: 0
-TYPE Records: 3450
Records: 3450
-TYPE Lines: 3450
Lines: 3450
-*-TYPE &FOCFEXNAME
-*-TYPE &FOCINCLUDE
-*-TYPE &FOCREL
-*-TYPE &FOCEXURL
-*-TYPE &READS
-*-TYPE &SETFILE
-IF 1 LT 56 GOTO STARTLOOP;
-STARTLOOP
-SET &I = 1 + 1;
-READ STO_GET_FILENAME_USE NOCLOSE &LEVEL2.A25. &TYPE2.A25.
-*
-IF 0 NE 0 GOTO ENDLOOP;
-*
-SET &TYPE_NEW = LJUST(25, att_rpt_log_11_p1 , 'A25');
-SET &FOC_MAS_NAME = att_rpt_log_11_p1 ;
-*
-SET &HOLD_LOOP = 'ON TABLE HOLD AS STO_ATT_LOG_LOOP FORMAT FOCUS INDEX HIT_STR';
-SET &FFILE_USE_1 = 'logs/' | att_rpt_log_11_p1.txt ;
-*
APP FI FF_ATT_LOG DISK logs/att_rpt_log_11_p1.txt
-*
TABLE FILE FF_ATT_LOG
PRINT
HIT_RPT
HIT_DTE
HIT_TME
HIT_DIV
HIT_REG
HIT_DST
HIT_STR
HIT_FLG
HIT_EID
ON TABLE HOLD AS STO_ATT_LOG_LOOP FORMAT FOCUS INDEX HIT_STR
END
-RUN
1
0 NUMBER OF RECORDS IN TABLE= 4071 LINES= 4071
0
-SET &FOCERRMSG = FEXERR(0 , 'A72');
-TYPE ERROR
ERROR
-TYPE FOCFOCEXEC: _dw_att_log.fex
FOCFOCEXEC: _dw_att_log.fex
-TYPE FOCERRNUM: 0
FOCERRNUM: 0
-TYPE RETCODE: 0
RETCODE: 0
-TYPE ACCEPTS: 4071
ACCEPTS: 4071
-TYPE FOCERRNUM: 0
FOCERRNUM: 0
-TYPE Records: 4071
Records: 4071
-TYPE Lines: 4071
Lines: 4071
-*-TYPE &FOCFEXNAME
-*-TYPE &FOCINCLUDE
-*-TYPE &FOCREL
-*-TYPE &FOCEXURL
-*-TYPE &READS
-*-TYPE &SETFILE
-IF 2 LT 56 GOTO STARTLOOP;
-STARTLOOP
-SET &I = 2 + 1;
-READ STO_GET_FILENAME_USE NOCLOSE &LEVEL3.A25. &TYPE3.A25.
-*
-IF 0 NE 0 GOTO ENDLOOP;
-*
-SET &TYPE_NEW = LJUST(25, att_rpt_log_12_p1 , 'A25');
-SET &FOC_MAS_NAME = att_rpt_log_12_p1 ;
-*
-SET &HOLD_LOOP = 'ON TABLE HOLD AS STO_ATT_LOG_LOOP FORMAT FOCUS INDEX HIT_STR';
-SET &FFILE_USE_1 = 'logs/' | att_rpt_log_12_p1.txt ;
-*
APP FI FF_ATT_LOG DISK logs/att_rpt_log_12_p1.txt
-*
TABLE FILE FF_ATT_LOG
PRINT
HIT_RPT
HIT_DTE
HIT_TME
HIT_DIV
HIT_REG
HIT_DST
HIT_STR
HIT_FLG
HIT_EID
ON TABLE HOLD AS STO_ATT_LOG_LOOP FORMAT FOCUS INDEX HIT_STR
END
-RUN
(FOC1271) DFIX: RECORD # 2440. FIELD 'HIT_FLG' (# 9) IS TRUNCATED.
ORIGINAL LEN = 6
(FOC1049) ERROR IN READING NEXT RECORD : ff_att_log
1
0 NUMBER OF RECORDS IN TABLE= 2439 LINES= 2439
0
-SET &FOCERRMSG = FEXERR(0 , 'A72');
-TYPE ERROR
ERROR
-TYPE FOCFOCEXEC: _dw_att_log.fex
FOCFOCEXEC: _dw_att_log.fex
-TYPE FOCERRNUM: 0
FOCERRNUM: 0
-TYPE RETCODE: 0
RETCODE: 0
-TYPE ACCEPTS: 2439
ACCEPTS: 2439
-TYPE FOCERRNUM: 0
FOCERRNUM: 0
-TYPE Records: 2439
Records: 2439
-TYPE Lines: 2439
Lines: 2439
-*-TYPE &FOCFEXNAME
-*-TYPE &FOCINCLUDE
-*-TYPE &FOCREL
-*-TYPE &FOCEXURL
-*-TYPE &READS
-*-TYPE &SETFILE
-IF 3 LT 56 GOTO STARTLOOP;


7.6.8
UNIX
FOCUS,HTML,PDF,EXCEL.
 
Posts: 18 | Registered: September 29, 2010Report 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     Need to capture WF Errors

Copyright © 1996-2020 Information Builders