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.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] DBA security and MFD_PROFILE

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] DBA security and MFD_PROFILE
 Login/Join
 
Member
posted
I am attempting to understand how I can make MFD_PROFILE more dynamic\data driven. In order to do so I have come up with the following sample.

---empdata.mas---
FILENAME=EMPDATA, SUFFIX=FOC , MFD_PROFILE=DDBAEMP, $
VARIABLE NAME=&&Emptitle, USAGE=A30, DEFAULT='EMPID', $
SEGMENT=EMPDATA, SEGTYPE=S1, $
FIELDNAME=PIN, ALIAS=ID, USAGE=A9, FIELDTYPE=I, $
FIELDNAME=LASTNAME, ALIAS=LN, USAGE=A15, $
FIELDNAME=FIRSTNAME, ALIAS=FN, USAGE=A10, $
FIELDNAME=MIDINITIAL, ALIAS=MI, USAGE=A1, $
FIELDNAME=DIV, ALIAS=CDIV, USAGE=A4, $
FIELDNAME=DEPT, ALIAS=CDEPT, USAGE=A20, $
FIELDNAME=JOBCLASS, ALIAS=CJCLAS, USAGE=A8, $
FIELDNAME=TITLE, ALIAS=CFUNC, USAGE=A20, $
FIELDNAME=SALARY, ALIAS=CSAL, USAGE=D12.2M, $
FIELDNAME=HIREDATE, ALIAS=HDAT, USAGE=YMD, $
DEFINE AREA/A13=DECODE DIV (NE 'NORTH EASTERN' SE 'SOUTH EASTERN'
CE 'CENTRAL' WE 'WESTERN' CORP 'CORPORATE' ELSE 'INVALID AREA'); $
DEFINE TYPE_EMP/I1=DECODE JOBCLASS(JOBS ELSE 1); $
DEFINE EMP_TYPE/A10=IF TYPE_EMP EQ 1
THEN 'FULL_TIME' ELSE 'PART_TIME'; $
END
DBA=USERD, $
USER=USER1, ACCESS=R, RESTRICT=FIELD, NAME=SALARY, $
USER=USER2, ACCESS=R, RESTRICT=VALUE, NAME=SYSTEM, VALUE=DEPT EQ SALES OR MARKETING, $
USER=USER3, ACCESS=R, RESTRICT=NOPRINT, NAME=SALARY, $
USER=HR1, ACCESS=R, RESTRICT=VALUE, NAME=SYSTEM, VALUE=SALARY FROM 20000 TO 35000, $
USER=HR2, ACCESS=R, RESTRICT=VALUE, NAME=EMPDATA, VALUE=SALARY GT 0, $
USER=HR3, ACCESS=R, RESTRICT=VALUE, NAME=SYSTEM, VALUE=JOBCLASS EQ (JOBS), $

---ddbaemp.fex---
-*new file
FILEDEF JOBS DISK jobs.ftm
-RUN
SET &ECHO=ALL;
-SET &&Emptitle = 'Employee ID';

TABLE FILE JOBLIST
PRINT
JOBLIST.JOBSEG.JOBDESC
JOBLIST.JOBSEG.JOBCLASS
WHERE JOBDESC CONTAINS '&CTR';
ON TABLE NOTOTAL
ON TABLE HOLD AS JOBS
END

---dbatest.fex---
-SET &ECHO=ALL;
-SET &CTR = IF &CNT EQ 1 THEN '2ND'
- ELSE '3RD';
SET USER = &UID;

TABLE FILE JOBLIST
PRINT
JOBLIST.JOBSEG.JOBDESC
JOBLIST.JOBSEG.JOBCLASS
WHERE JOBDESC CONTAINS '&CTR';
ON TABLE NOTOTAL
ON TABLE HOLD AS JOBS
END

TABLE FILE EMPDATA
"User is &UID "
" "
"USER1 -- Can't see Salary, reject request"
"USER2 -- Can see Sales and Marketing departments only"
"USER3 --can't see Salary, will be blanked out"
"HR1 -- Can see salaries from 20 TO 35 K "
"HR2 -- Can see everyone "
"HR3 -- Can see Part Time only "
" "
PRINT
&CNT
&CTR
PIN
SALARY
DEPT
EMP_TYPE
ON TABLE SET PAGE NOPAGE
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, FONT=ARIAL,$
END

When I run the dbatest fex I get the following regardless of the value of the CNT and UID variables:

-SET &CTR = IF 1 EQ 1 THEN '2ND'
- ELSE '3RD';
SET USER = 1;
TABLE FILE JOBLIST
PRINT
JOBLIST.JOBSEG.JOBDESC
JOBLIST.JOBSEG.JOBCLASS
WHERE JOBDESC CONTAINS '2ND';
ON TABLE NOTOTAL
ON TABLE HOLD AS JOBS
END
TABLE FILE EMPDATA
"User is 1 "
" "
"USER1 -- Can't see Salary, reject request"
"USER2 -- Can see Sales and Marketing departments only"
"USER3 --can't see Salary, will be blanked out"
"HR1 -- Can see salaries from 20 TO 35 K "
"HR2 -- Can see everyone "
"HR3 -- Can see Part Time only "
" "
PRINT
1
2ND
PIN
SALARY
DEPT
EMP_TYPE
ON TABLE SET PAGE NOPAGE
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, FONT=ARIAL,$
END
0 NUMBER OF RECORDS IN TABLE= 2 LINES= 2
0 ERROR AT OR NEAR LINE 11 IN PROCEDURE DDBAEMP FOCEXEC *
(FOC295) A VALUE IS MISSING FOR: &CTR

I am not sure what I am doing wrong I expected the CTR variable to be available in the profile as is the case with most fex(es).
BTW, I am a complete FOCUS newbie!

Thanks in advance!

WebFocus 7.7.04 and Dev studio 7703

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 16 | Registered: September 12, 2012Report This Post
Virtuoso
posted Hide Post
The MFD profile is executed, not included. Change the &CTR to &&CTR. That may not be everything that is wrong here, but it will allow you to continue.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report 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     [CLOSED] DBA security and MFD_PROFILE

Copyright © 1996-2020 Information Builders