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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     -INCLUDE RETURN CODE MESSAGES

Read-Only Read-Only Topic
Go
Search
Notify
Tools
-INCLUDE RETURN CODE MESSAGES
 Login/Join
 
Master
posted
I have created a driver fex that runs a stream of fexes for a monthly production run.

At this point, I have the following code:
-TYPE ___________________________________________________
-TYPE Starting Car1.fex: ( &BEG1 - &END1 ) FREQ = &FREQ
-RUN
-INCLUDE CAR1
-RUN
-TYPE Ending Car1 Fex: ( &BEG1 - &END1 ) FREQ = &FREQ
-TYPE ___________________________________________________
-RUN
-EXIT
-***********

However, if I remove the -RUN below the -INCLUDE car1.fex statement, I will see
this message when I click on view source:
___________________________________________________
Starting Car1.fex: ( 2008/07/01 - 2008/09/30 ) FREQ = Q
Ending Car1 Fex: ( 2008/07/01 - 2008/09/30 ) FREQ = Q
___________________________________________________
0 NUMBER OF RECORDS IN TABLE= 4 LINES= 4

Then if I put the -RUN back to follow the -INCLUDE CAR1 statement, I see this message:

Starting Car1.fex: ( 2008/07/01 - 2008/09/30 ) FREQ = Q
0 NUMBER OF RECORDS IN TABLE= 4 LINES= 4

Does anyone have any DM code that will effectively monitor that a called FEX is about to
start its run, and when it is complete, with the statistics - hopefully - displaying before a
message appears that it has completed?.

What about capturing a return code in the fex (at end) and passing that value back to
driver fex?

Thanks! Wink


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Expert
posted Hide Post
Tom,

You need the -RUN to force the execution of the code in car1.fex before you can type out a message saying that the fex is complete.

If you don't have the -RUN, all the DM commands run first before FOCSTACK is executed.

If you want to test a return code, &LINES is as good as any.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Virtuoso
posted Hide Post
quote:
Does anyone have any DM code that will effectively monitor that a called FEX is about to
start its run, and when it is complete, with the statistics - hopefully - displaying before a
message appears that it has completed?.

Where I worked previously, we allocated a file in a directory when the caster job ran and then did -WRITE commands to the file with various information. As Ginny indicates, for most control, the -RUN should be used. For our purposes we didn't use it often.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Virtuoso
posted Hide Post
Tom,

Ginny gave you the "secret". When you run a WF procedure you have to be a bit schyzophrenic... or think "stereo".
Focexecs are read sequentially from line 1. If a line starts with a '-' it is executed immediately. If it doesn't, the line is written to the FOCSTACK. When either -RUN, -EXIT or last line is encountered, whatever has accumulated in the FOCSTACK is executed.
Hence, what you have observed.
As for testing "return codes" you have a choice:
&RECORDS (number of records extracted)
&LINES (number of lines generated)
&READS (number of records read from an external data source)
&BASEIO (number of I/O on a Focus db)
&FOCERRNUM (number of last error encountered - should be 0)

For efficiency, you can use &FOCCPU which shows the amount of CPU milliseconds. For example:
  
-* File ByTocXL.fex
-SET &START= &FOCCPU;
TABLE FILE CAR
SUM SALES
BY COUNTRY NOPRINT
BY CAR BY BODY
ON TABLE SET BYDISPLAY ON
ON TABLE HOLD FORMAT EXL2K BYTOC
END
-RUN
-SET &END= &FOCCPU;
-SET &USEDCPU=&END - &START;
-TYPE USED CPU = &USEDCPU


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Master
posted Hide Post
I tested your code exactly as provided with -RUN immediately after the Table Request.

-SET &ECHO=ALL;

-SET &START = &FOCCPU;
-TYPE START = &FOCCPU
-*
TABLE FILE CAR
SUM SALES
BY COUNTRY NOPRINT
BY CAR BY BODY
END
-RUN
-*
-SET &ENDZ = &FOCCPU;
-TYPE ENDZ = &FOCCPU
-SET &USEDCPU = (&ENDZ - &START);
-TYPE USED CPU = &USEDCPU

As the &ECHO display indicates, the &ENDZ and &USEDCPU are ignored:


< !--
-SET &START = 2453 ;
-TYPE START = 2453
START = 2453
-*
TABLE FILE CAR
SUM SALES
BY COUNTRY NOPRINT
BY CAR BY BODY
END
-RUN
0 NUMBER OF RECORDS IN TABLE= 13 LINES= 13

WebFOCUS Version 7.1.4 compiled and linked on Fri May 19 16:45:40 EDT 2006 (Gen branch714:284)
-->

In order to get the Used CPU value, I have to modify the code to this:
-*
TABLE FILE CAR
SUM SALES
BY COUNTRY NOPRINT
BY CAR BY BODY
END

-*
-SET &ENDZ = &FOCCPU;
-TYPE ENDZ = &FOCCPU
-SET &USEDCPU = (&ENDZ - &START);
-TYPE USED CPU = &USEDCPU
----------------------------------------------------------------------
and, I see this in the &ECHO display:

< !--
-SET &START = 2562 ;
-TYPE START = 2562
START = 2562
-*
TABLE FILE CAR
SUM SALES
BY COUNTRY NOPRINT
BY CAR BY BODY
END
-*
-SET &ENDZ = 2562 ;
-TYPE ENDZ = 2562
ENDZ = 2562
-SET &USEDCPU = (2562 - 2562 );
-TYPE USED CPU = 0
USED CPU = 0
0 NUMBER OF RECORDS IN TABLE= 13 LINES= 13

This is awkward because I see the CPU metrics before I see the
&LINES/&RECORDS info. It works, but is not the "ideal" that
some user(s) and developer(s) would prefer to live with.
----------------------------------------------------------------------
Lastly, If I place a -RUN after the TABLE Request, &ENDZ and
&USEDCPU coding, I get the same results.
-*
TABLE FILE CAR
SUM SALES
BY COUNTRY NOPRINT
BY CAR BY BODY
END

-*
-SET &ENDZ = &FOCCPU;
-TYPE ENDZ = &FOCCPU
-SET &USEDCPU = (&ENDZ - &START);
-TYPE USED CPU = &USEDCPU
-RUN
-*
and, I see this in the &ECHO display:
-*
TABLE FILE CAR
SUM SALES
BY COUNTRY NOPRINT
BY CAR BY BODY
END
-*
-SET &ENDZ = 718 ;
-TYPE ENDZ = 718
ENDZ = 718
-SET &USEDCPU = (718 - 718 );
-TYPE USED CPU = 0
USED CPU = 0
-RUN
0 NUMBER OF RECORDS IN TABLE= 13 LINES= 13

WebFOCUS Version 7.1.4 compiled and linked on Fri May 19 16:45:40 EDT 2006 (Gen branch714:284)
-->

I wonder if the particulars of Ver. 7.1.4 is part of the problem.

Thanks. Eeker


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Expert
posted Hide Post
Depending on the robustness of the table request, it may not take enough cpu to get the variable to register. For instance, a report against the CAR file as you show in your post may only take milliseconds of cpu to execute. If the variable &FOCCPU is cpu in seconds, you'll never see anything.

I'd go with &RECORDS and &LINES and possibly the HHMMSS subroutine. Here is an example.

--SET &ECHO=ON;
-SET &BEGTIME=HHMMSS('A8');
-TYPE &BEGTIME
TABLE FILE CENTURYSALES
PRINT *
ON TABLE HOLD
END
-RUN
-SET &ENDTIME=HHMMSS('A8');
-TYPE &ENDTIME
-TYPE RECORDS READ &RECORDS
-TYPE LINES IN REPORT &LINES

gives you

 08.53.01
 TABLE FILE CENTURYSALES
 PRINT *
 ON TABLE HOLD
 END
 1
 0 NUMBER OF RECORDS IN TABLE=    32283  LINES=  32283
 0
 08.53.02
 RECORDS READ    32283
 LINES IN REPORT    32283


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Virtuoso
posted Hide Post
Tom,

Very strange. See the following:
  
 -SET &START= 11062   ;
 TABLE FILE CAR
 SUM SALES
 BY COUNTRY NOPRINT
 BY CAR BY BODY
 ON TABLE SET BYDISPLAY ON
 ON TABLE HOLD FORMAT EXL2K BYTOC
 END
 -RUN
 0 NUMBER OF RECORDS IN TABLE=       18  LINES=     13
 0 EXL2K FILE SAVED ...
 -SET &END= 11109   ;
 -SET &USEDCPU=11109    - 11062   ;
 -TYPE USED CPU = 47
 USED CPU = 47


Could you try my example as it is?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report 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     -INCLUDE RETURN CODE MESSAGES

Copyright © 1996-2020 Information Builders