October 18, 2007, 10:32 AM
Ed HoganWebFOCUS 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?
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.
October 18, 2007, 01:02 PM
Ed HoganHi 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