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] eval amper and field

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] eval amper and field
 Login/Join
 
Platinum Member
posted
I have a few variables defined such as &KEY1, &KEY2, &KEY3, etc and I'm trying to access these values in a report:

-SET &KEY112847612 = 'HELLO';
TABLE FILE EMPLOYEE
PRINT DST.EMP_ID
COMPUTE MSG/A20 = '&|KEY'|EMP_ID;
END

Obviously I want Hello printed for the specific employee, but what you get is the name of the variable. Is there a way to EVAL this, so I get the right value?

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


Thanks.

Mark
WF 7.6 Windows
 
Posts: 150 | Registered: July 26, 2007Report This Post
Virtuoso
posted Hide Post
You can't mix your &variables with define/compute fields like that. You have set a value for a specific variable name - &KEY112847612. That &var is not re-evaluated for every record in your table request so you cannot create another &var based on a specific record, as you're trying to do in your compute. Also EVAL is used with &vars, not real or virtual fields.

There are multiple ways to accomplish what it appears you are trying to do (COMPUTE MSG/A20=IF EMP_ID EQ '&KEY' THEN 'HELLO' ELSE '';) but I don't know if you were looking for a solution to a specific problem or needing a technique to use for some other problem.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Expert
posted Hide Post
You are trying to concatenate an Amper variable to a field in a tabel request. this will not work.

If you have a list of & variables with some text related to them, then I would suggest writing them to a file and either joining or matching or decoding the values.

Write the file in the format EMP_ID MSG.

e.g.
FILEDEF EMP_LUP DISK emp_lup.ftm

EX -LINES 2 EDAPUT FOCTEMP,EMP_LUP,CV,FILE
112847612 'HELLO'

-RUN

TABLE FILE EMPLOYEE
PRINT DST.EMP_ID
COMPUTE MSG/A20 = DECODE EMP_ID(EMP_LUP ELSE ' ');
END


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
DL
Yeah, I'm need to be more dynamic, that is, do something based on a value in the table.

Waz
I think you're onto the right solution for my situation.

Thanks both for the quick responses.


Thanks.

Mark
WF 7.6 Windows
 
Posts: 150 | Registered: July 26, 2007Report This Post
Member
posted Hide Post
-* THIS FOCEXEC WORKS FOR &KEY112847612 VALUES UP TO 19 CHARACTERS LONG
-SET &KEY112847612 = 'HELLO';
-* ADDING 1 TO THE LENGHT ADDS 1 SPACE TO &KEY112847612
-SET &KEYLEN= &KEY112847612.LENGTH + 1;
-* DETERMINE APPROPRIATE FORMAT FOR DEFINED VARIABLE MSG
-SET &KEYFORMAT = 'A' | &KEYLEN;
DEFINE FILE EMPLOYEE
MSG/&KEYFORMAT WITH EMP_ID =
SUBSTR(&KEYLEN,'&KEY112847612',1,&KEYLEN,&KEYLEN,MSG);
END
TABLE FILE EMPLOYEE
PRINT DST.EMP_ID
COMPUTE MSG/A20 = MSG|EMP_ID;
END


UNIX
HTML, PDF, and EXCEL
 
Posts: 1 | Registered: May 26, 2009Report This Post
Virtuoso
posted Hide Post
quote:
-* THIS FOCEXEC WORKS FOR &KEY112847612 VALUES UP TO 19 CHARACTERS LONG


It sounds like he only wants the message to print for a certain pre-determined id - not for all of them. Either reading all the necessary information into amper variables or using a fex to "pre-create" the associations between ID and message, as suggested by Waz, is what you need.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report 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] eval amper and field

Copyright © 1996-2020 Information Builders