Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    Focus Format Errors Handling
Go
New
Search
Notify
Tools
Reply
  
Focus Format Errors Handling
 Login/Join
 
Platinum Member
posted
Hello,

Using DataMigrator 7.6.2 having the process flow which has custom condition (&RET_CODE EQ 0) to go the next item in the process flow. But we are getting the FOCUS format errors like "FOC1346" & "FOC1130" which doesn't flagged FOCERRNUM to zero and it continue to run the next item and we want to stop the execution of the flow.
Is it possible to handle the FOCUS format error like DBMS errors.

Thanks in advance for help !


WF 7.6.2/ OS WIN2003.
DM 7.6.2
 
Posts: 103 | Registered: September 08, 2006Reply With QuoteReport This Post
Platinum Member
posted Hide Post
The answer to this will depend on where the FOCUS formatting errors (FOC1346 & FOC1130) are coming from: is it another process flow, a data flow or a stored procedure?

If it's a stored procedure, then it will be easy. If it's a data flow or another process flow, it gets more complicated. Also, just as an aside, what is causing your formatting errors to begin with? This will be important if the errors are coming out of another process flow or data flow.

If they are coming out of a stored procedure, then capture the errors withn the stored procedure by checking for &FOCERRNUM after every table file request, like this:
-RUN
-IF &FOCERRNUM NE 0 GOTO ERR_ROUTINE;

If it's not zero, route to an error routine where you can set a global variable, for example, &&ERR_FOUND. I have this at the bottom of all my stored procedures:

-GOTO JOB_FINISHED

-ERR_ROUTINE
-TYPE ERROR ENCOUNTERED: &FOCERRNUM
-SET &&ERR_FOUND = 'Y';

-JOB_FINISHED
-TPE ERR_FOUND: &&ERR_FOUND

You'll need to set &&ERR_FOUND to 'N' at the top of your stored procedure as the default.

You can change the custom condition to check for both &RET_CODE and &&ERR_FOUND like this: (&RET_CODE EQ 0) AND (&&ERR_FOUND EQ 'N'). This will cause it to only go to the next step if &&ERR_FOUND was a 'N'. You can also add an email icon object after your stored procedure, set the condition to custom for that too but make it (&RET_CODE NE 0) OR (&&ERR_FOUND EQ 'Y'). This will send an email if an error is encountered. You can embed amper variables in these emails. I find that very helpful.

With stored procedures, it's easy. I do it all time. But with process flows and data flows, not so simple. The solution really depends on what the flow was supposed to do. If the flow was supposed to load something or create some kind of file, you'll have to create another stored procedure checking for the existance of the data in the target table or the existance of the file. If whatever was supposed to happen did not, then use the same process I outlined above about setting &&ERR_FOUND, etc.

Good Luck.

Jessica Bottone


Data Migrator 5.3, 7.1, 7.6
WebFOCUS 7.1, 7.6, 7.7
SQL Server, Oracle, DB2
Windows
 
Posts: 126 | Registered: January 18, 2007Reply With QuoteReport This Post
Guru
posted Hide Post
OTOH if you ARE using a DataMigrator DataFlow... You can detect FORMAT errors when you use a DIRECT LOAD flow. Say you have a source synonym like this:

  
FILENAME=flatin, SUFFIX=FIX     ,
 DATASET=baseapp/flatin.ftm (RECFM F, $
  SEGMENT=FLAT, SEGTYPE=S0, $
    FIELDNAME=NAME, ALIAS=NAME, USAGE=A4, ACTUAL=A4,$
    FIELDNAME=NUM, ALIAS=NUM, USAGE=I4, ACTUAL=A4,$


And input data like this:
ONE 000I
TWO 0002


The first line will cause a conversion error because the number isn't one.
When you use that as a source in a direct load flow you will get a log like this:

(FOC1346)  : FORMAT ERROR: Record      1 , Column     4 
(FOC1130) FORMAT CONVERSION ERROR FIELD/KEY  : NAME     
Commit forced at:      2 for      2 row(s)              
-- stats for source file                                
2 : Row(s) processed by job                             
1 : Row(s) rejected due to format error                 
-- stats for target file: flatout                       
2 : Row(s) processed by job                             
....


Note that there was 1 row rejected due to a format error. That will set the statistical variable &FORMAT to the value 1. You can test for that in a process flow just like you would for &DBMSERROR.

Note that for &FORMAT to be referenced either (a) the data flow must be purple (embedded) in the process flow or (b) if it's blue it must have "Execute as RPC" checked.
 
Posts: 379 | Location: New York City | Registered: May 03, 2007Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Thanks for the responses.

Focus format errors are happening at the Dataflow which is part of the process flow.
As clif mentioned now looking for &FORMAT and &DBMSERROR number. Now plan to set the condition
like &FORMAT EQ 0 or & &DBMSERROR EQ 10000000 then only continue the next item in the process flow. I will update with the result.
Thanks !


WF 7.6.2/ OS WIN2003.
DM 7.6.2
 
Posts: 103 | Registered: September 08, 2006Reply With QuoteReport This Post
Platinum Member
posted Hide Post
I did not know about the variable &FORMAT. I know about the ones that will tell you how many records were added, updated and/or deleted, but not that one. Learn something new every day! :-) Thanks Clif.


Data Migrator 5.3, 7.1, 7.6
WebFOCUS 7.1, 7.6, 7.7
SQL Server, Oracle, DB2
Windows
 
Posts: 126 | Registered: January 18, 2007Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    Focus Format Errors Handling

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.