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     Place field value into program &variable

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Place field value into program &variable
 Login/Join
 
Platinum Member
posted
Hi all,

This is one of those times where I have been avoiding asking this question all day as I am so sure if must be something from lesson 101! However myself and a colleague haven't seen the light yet:

We need to extract a value from a field and place it into an &variable so it can be used in our program.

Our report will always return 1 row and we need this one value from the one returned field to go into an &variable.

Currently the only methods I know of sending a value to a variable are when I do a drill down and we can set &parm1=N1, &parm2=N2 etc. We thought (but doubted) that perhaps you could reference a Computed field outside of the report or perhaps perform a -SET in the report, but alas neither of these are valid!

Example:

-DEFAULT &ORDER

TABLE FILE TEST
PRINT
COMPUTE &ORDER = ORDER_NO;
-SET &ORDER = ORDER_NO;
WHERE READLIMIT EQ '1';
END
-RUN

-TYPE &ORDER


Thanks in advance for your help as always, and I am ready to be embarrassed!

Cheers

Mark


WebFocus 765. iSeries v5r4
 
Posts: 175 | Location: England | Registered: April 11, 2006Report This Post
Virtuoso
posted Hide Post
WHERE ORDER_NO EQ '&ORDER.(FIND ORDER IN TEST).ORDER.';

I think this is what you are asking...


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Platinum Member
posted Hide Post
Thanks Prarie,

I think perhaps my example confused things as I don't think that is what I am lookig for.

I want the result of a query to be placed into an &variable, so it can be used outside of the report. I'll have another go:

TABLE FILE TEST
PRINT
ORDER_NO
END
-RUN

-IF ORDER_NO EQ '123' THEN GOTO REPORT_A;
-IF ORDER_NO EQ '456' THEN GOTO REPORT_B;
-IF ORDER_NO EQ '789' THEN GOTO REPORT_C;

Now we can't reference a field (ORDER_NO) outside of a report, so I want the contents of the field to be placed into an &variable so we can access the value and use the -IF statements.

Cheers Smiler


WebFocus 765. iSeries v5r4
 
Posts: 175 | Location: England | Registered: April 11, 2006Report This Post
Expert
posted Hide Post
quote:

Our report will always return 1 row and we need this one value from the one returned field to go into an &variable.




TABLE FILE TEST
PRINT
ORDER_NO
ON TABLE SAVE AS ORDER_NO
END
-RUN
-READ ORDER_NO &ORDER.A3.
-IF &ORDER EQ '123' THEN GOTO REPORT_A;
-IF &ORDER EQ '456' THEN GOTO REPORT_B;
-IF &ORDER EQ '789' THEN GOTO REPORT_C;


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Platinum Member
posted Hide Post
Cheers Tom! That works a treat.

Not so embarrased now, READ is a new command to us.

Good One


WebFocus 765. iSeries v5r4
 
Posts: 175 | Location: England | Registered: April 11, 2006Report 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     Place field value into program &variable

Copyright © 1996-2020 Information Builders