Focal Point
WebFOCUS Double Inserting to DB2 Table

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4621005252

October 18, 2007, 10:32 AM
Ed Hogan
WebFOCUS Double Inserting to DB2 Table
I've written a small FEX to track WebFOCUS Report usage by capturing the UserId, FEX Name, and a DateTimeStamp. These three fields are inserted into a DB2 Table built specifically for that purpose.

The FEX is "-INCLUDE'd" as the first line of each Report FEX that I want to track.

WebFOCUS seems to be performing double inserts, about 10 to 15 seconds apart.

Here is the FOCUS code:

-*** Strip the leading underscore from the &FOCFOCEXEC value
-*** and convert to upper case
-SET &A = ABS(&FOCFOCEXEC.LENGTH);
-SET &F = &A - 1;
-SET &FFMT = 'A' | &F;
-SET &RPTNM = SUBSTR(&A, &FOCFOCEXEC, 2, &A, &F, '&FFMT');
-SET &UCRPTNM = UPCASE(&F, &RPTNM, 'A8');
-*** Convert the TSOID to upercase
-SET &U = ABS(&IBIC_user.LENGTH);
-SET &USERID = UPCASE(&U, &IBIC_user, 'A7');
-*** Get the create date time stamp with micorsecond precision
-SET &DTSTMP = HGETC(10, 'HYYMDm');
-SET &DTSTMPX = HCNVRT(&DTSTMP,'(HYYMDm)',26,'A26');
-*WRITE PLUSRLG &UCRPTNM &USERID &DTSTMPX
-RUN
-SET &ECHO=ALL;
-RUN
SQL
INSERT INTO PLTUSRLG
(FOC_NA, RQSTR_UID_C, RQST_TS)
VALUES('&UCRPTNM', '&USERID', '&DTSTMPX');
COMMIT;
END
-RUN

Any ideas why? Or how to prevent the double insert?


WebFOCUS 716 MVS DB2 AIX UDB
October 18, 2007, 12:41 PM
Jason K.
are you -INCLUDE'ing more than once?
could you be running it as a pre or post proc in reportcaster?

your code will do one insert into your database.


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
October 18, 2007, 01:02 PM
Ed Hogan
Hi Jason,

No just one -INCLUDE, as the first line in the Report FEX's (we have over 600 of 'em). Most of our FEX's are requested via the WebFOCUS client, i.e. HTML menus run off of our WebFOCUS WebServer. We only have a few RCaster reports.


Ed


WebFOCUS 716 MVS DB2 AIX UDB