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     how to pass multiple values to an included procedure

Read-Only Read-Only Topic
Go
Search
Notify
Tools
how to pass multiple values to an included procedure
 Login/Join
 
<new2focus>
posted
ITEM_MASTER
-----------
dept_id varchar2(10);
category varchar2(10);
cat_desc varchar2(25);

How can I get all the category and cat_desc from the item_master table
and pass it to an included procedure inside a loop? I am able to pass
one variable at a time as follows (is there a better way of doing it?).
But I don't know how to read multiple values from the stack. Any ideas?

TABLE FILE ITEM_MASTER
BY CATEGORY
WHERE ( DEPT_ID EQ '23');
ON TABLE HOLD AS CAT_HLD FORMAT ALPHA
END
-RUN

-SET &CAT_COUNT = &LINES;
-REPEAT LOOP1 FOR &CNT FROM 1 TO &CAT_COUNT;
-READ CAT_HLD &TMPVAR.A8. NOCLOSE
-SET &CAT_LIST.&CNT = &TMPVAR;
-LOOP1
-CLOSE CAT_HLD

-REPEAT CAT_LOOP FOR &CNT FROM 1 TO &CAT_COUNT;
-SET &category=&CAT_LIST.&CNT;
-INCLUDE cat_details
-INCLUDE cat_item_details
-CAT_LOOP
END
 
Report This Post
Guru
posted Hide Post
What are you trying to do with the variables?
Are they being used in a WHERE statement in the included fex?

A little more information on what you are really trying to do would be great.
 
Posts: 406 | Location: Canada | Registered: May 31, 2004Report This Post
<new2focus>
posted
I need the category to use in where class and the description to display on the sub head of the included report.
 
Report This Post
Gold member
posted Hide Post
Here you go (tested on WF 528).
Solution 1: Single -REPEAT


TABLE FILE CAR
PRINT COUNTRY CAR
ON TABLE SAVE AS CARHLD
END
-RUN
-SET &NBR = &LINES;

-REPEAT L_LOOP1 &NBR TIMES
-READ CARHLD NOCLOSE &CTR.10. &CAR.16.
-*## from her this can be in -INCLUDE
TABLE FILE CAR
PRINT COUNTRY CAR
WHERE COUNTRY EQ '&CTR' AND CAR EQ '&CAR';
END
-*## until her this can be in -INCLUDE
-L_LOOP1
[/code]And solution 2: Two -REPEAT
[code]
TABLE FILE CAR
PRINT COUNTRY CAR
ON TABLE SAVE AS CARHLD
END
-RUN
-SET &NBR = &LINES;

-REPEAT L_LOOP1 FOR &IND FROM 1 TO &NBR ;
-READ CARHLD NOCLOSE &CTR.&IND.10. &CAR.&IND.16.
-L_LOOP1

-REPEAT L_LOOP2 FOR &IND FROM 1 TO &NBR ;
-SET &WCTR = &CTR.&IND;
-SET &WCAR = &CAR.&IND;
-*## from her this can be in -INCLUDE
TABLE FILE CAR
PRINT COUNTRY CAR
WHERE COUNTRY EQ '&WCTR' AND CAR EQ '&WCAR';
END
-*## until her this can be in -INCLUDE
-L_LOOP2

-INCLUDE just adds more code to the actual procedure. Therefore it is not a call like EX and so you cannot provide parameters with it. But as it is just an enhancement of the actual procedure, it will always know of all active DM variables. So you just have to -SET whatever you need.

This message has been edited. Last edited by: <Mabel>,
 
Posts: 54 | Location: Switzerland | Registered: May 13, 2003Report This Post
<new2focus>
posted
Thanks Roland!
-READ CARHLD NOCLOSE &CTR.&IND.10. &CAR.&IND.16.
This syntax is what i was looking for Razzer
 
Report This Post
Guru
posted Hide Post
Since you are using the hold file data in a WHERE statement you could do the following:

TABLE FILE tablename
PRINT
fieldname
WHERE fieldname IN FILE CAT_HLD
END
 
Posts: 406 | Location: Canada | Registered: May 31, 2004Report This Post
<new2focus>
posted
Thats a very handy tip Curtis. Thanks!
 
Report 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     how to pass multiple values to an included procedure

Copyright © 1996-2020 Information Builders