Focal Point
[SOLVED!] IBIMR_user in DBA section of MFD

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

February 12, 2016, 12:01 PM
Mike in DeLand
[SOLVED!] IBIMR_user in DBA section of MFD
I want to use &IBIMR_user in my DBA area, like
USER=X, ACCESS=R, RESTRICT=VALUE_WHERE, NAME=SYSTEM, VALUE=somefieldinmydatabase = '&IBIMR_USER';

But, it doesn't get evaluated, and the literal "&IBIMR_user" gets passed to my database. If I add ".EVAL" onto it, that just gets added to the literal and it still doesn't get evaluated. What the heck am I doing wrong here?

02/15/2016 - WORKS!!!

I found on another thread, where you have to put a line "VARIABLE NAME=&&FOCSECUSER, USAGE=A50, $" in the top of the MFD, right before the SEGMENT line. Then, in the DBA part, I have
VALUE=myfield eq '&&FOCSECUSER' and now it gets evaluated and sent to the DBMS, and my report runs a million times faster.

This is the coolest...forum...ever!

This message has been edited. Last edited by: Mike in DeLand,


Webfocus 8
Windows, Linux
February 12, 2016, 02:17 PM
BabakNYC
I think CNCTUSR is set to the same value as IBIMR_user. Try using something like this and see if that works.

-SET &&USERID = CNCTUSR('A50');
-SET &&USERID = TRUNCATE(&&USERID);



WebFOCUS 8206, Unix, Windows
February 12, 2016, 03:00 PM
eric.woerle
Mike

You don't want to use &IBIMR_user variable because that gets set by the client through the Custom Settings. What this means is that anything that does not come in through the client won't have that value set. In version 8.0.08 things like Report Caster don't come in through the client (IBI has mentioned that in the future they will change this, because your Site Profile also doesn't run when using ReportCaster, but I don't know which version that change has/will occur). RC connects directly to the Reporting server so the variable &IBIMR_user never gets set.

The current recommended variable to use according to the IBI documentation is &FOCSECUSER which gets set by the Reporting Server. this is recommended over the GETUSER and CNCTUSR subroutines

Also I wouldn't put your value in quotes. I would use .QUOTEDSTRING instead. I always use .QUOTEDSTRING when evaluating my variables. Its cleaner and handles issues like what your experiencing

  
USER=X, ACCESS=R, RESTRICT=VALUE_WHERE, NAME=SYSTEM, VALUE=somefieldinmydatabase = &FOCSECUSER.QUOTEDSTRING;




Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
February 12, 2016, 03:46 PM
Mike in DeLand
I'll try focsecuser, thanks.

I tried CNTCUSER, but it doesn't get passed to the DBMS, and I think that slows down my processing since webfocus has to filter out what I want after the DBMS returns all the records. I hard-coded a value just to be sure it got through to the DBMS, and it did.


Webfocus 8
Windows, Linux
February 12, 2016, 04:06 PM
Mike in DeLand
quote:
Originally posted by eric.woerle:
Mike

You don't want to use &IBIMR_user variable because that gets set by the client through the Custom Settings. What this means is that anything that does not come in through the client won't have that value set. In version 8.0.08 things like Report Caster don't come in through the client (IBI has mentioned that in the future they will change this, because your Site Profile also doesn't run when using ReportCaster, but I don't know which version that change has/will occur). RC connects directly to the Reporting server so the variable &IBIMR_user never gets set.

The current recommended variable to use according to the IBI documentation is &FOCSECUSER which gets set by the Reporting Server. this is recommended over the GETUSER and CNCTUSR subroutines

Also I wouldn't put your value in quotes. I would use .QUOTEDSTRING instead. I always use .QUOTEDSTRING when evaluating my variables. Its cleaner and handles issues like what your experiencing

  
USER=X, ACCESS=R, RESTRICT=VALUE_WHERE, NAME=SYSTEM, VALUE=somefieldinmydatabase = &FOCSECUSER.QUOTEDSTRING;



Well, FOCSECUSER doesn't work either. I can -TYPE it at the top of my code and see that it displays the logged-on user, but in the MFD it's still just getting passed as a literal "FOCSECUSER" instead of the substituted value.


Webfocus 8
Windows, Linux
February 12, 2016, 04:20 PM
eric.woerle
did you use .QUOTEDSTRING as I suggested?


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
February 12, 2016, 04:28 PM
eric.woerle
As I think about it, you may need to use global variables in MFD files. So if .QUOTEDSTRING still isn't working add:

SET &&FOCSECUSER = &FOCSECUSER

to the edasprof.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
February 15, 2016, 09:20 AM
Mike in DeLand
Still no luck. I did what you said and the darn amper variable still doesn't get evaluated when Webfocus passes the sql statement to my DBMS.
I can't believe such a simple thing is so hard to accomplish.


Webfocus 8
Windows, Linux