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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Pass Field
 Login/Join
 
Silver Member
posted
Is there a way to pass a field from one request to another to use in the WHERE statement (all in the same procedure)?

TABLE FILE DIM_PERIOD
PRINT
AGT_TERM_DT
WHERE AGT_NBR EQ '01234';
END
-*
TABLE FILE DIM_PERIOD
SUM
NET_SALES
BY ACCT_NBR
WHERE INV_DT EQ (AGT_TERM_DT from above);
END

Thanks!!

Krysti


WF 767
 
Posts: 34 | Location: Chicago, IL | Registered: September 02, 2004Report This Post
Virtuoso
posted Hide Post
Try searching on Drill Downs...you should find lots of discussion.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Silver Member
posted Hide Post
It's not really a drill down though.


WF 767
 
Posts: 34 | Location: Chicago, IL | Registered: September 02, 2004Report This Post
Expert
posted Hide Post
TABLE FILE DIM_PERIOD
PRINT
AGT_TERM_DT
WHERE AGT_NBR EQ '01234';
-**************************
ON TABLE SAVE
END
-RUN
-READ SAVE &AGT_TERM_DT.A8.  (If AGT_TERM_DT format is YYYYMMDD:   20071023) 
        OR &AGT_TERM_DT.A10. (If AGT_TERM_DT format is YYYY/MM/DD: 2007/10/23)
-**************************
TABLE FILE DIM_PERIOD
SUM
NET_SALES
BY ACCT_NBR
-**************************
WHERE INV_DT EQ &AGT_TERM_DT;
-**************************
END
-RUN


Edit: Typo's

This message has been edited. Last edited by: Tom Flynn,


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
I presume that you expect a single value to be PRINTed by the first process.
In that case, try WRITEing it to a text file, then READing it back into an AmberVariable and using the AmberVariable in the second process's WHERE statement.

There are many FocalPoint threads explaining the WRITE then READ code needed to convert table row-column(s) into an &var(s).


WIN/2K running WF 7.6.4
Development via DevStudio 7.6.4, MRE, TextEditor.
Data is Oracle, MS-SQL.
 
Posts: 154 | Location: NY | Registered: October 27, 2005Report This Post
Expert
posted Hide Post
What's wrong with WHERE IN FILE?

TABLE FILE DIM_PERIOD
PRINT
AGT_TERM_DT
WHERE AGT_NBR EQ '01234';
ON TABLE HOLD AS H001 FORMAT ALPHA
END
-*
TABLE FILE DIM_PERIOD
SUM
NET_SALES
BY ACCT_NBR
WHERE INV_DT IN FILE H001
END


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
You can do either (1) TABLE/SAVE and then -READ it in or if you are hardocding the value do a (2) filedef then -write it out, and then -read it in

(1)
TABLE FILE CAR
PRINT CAR BY COUNTRY
WHERE COUNTRY EQ 'ITALY'
ON TABLE SAVE AS THESAVE
END
-RUN
-READ THESAVE &COUNTRY.A10.&CAR.A16.
TABLE FILE CAR
PRINT CAR BY COUNTRY
WHERE COUNTRY EQ '&COUNTRY'
END
-EXIT


(2)
-PART2
FILEDEF XXX DISK MYSAVE.DAT (LRECL 10
-SET &KOUNTRY = ' ';
-RUN
-SET &KOUNTRY = 'ITALY';
-WRITE XXX &KOUNTRY.A10.
-TYPE THE VALUE FOR COUNTRY IS &KOUNTRY
-RUN
TABLE FILE CAR
PRINT MODEL RCOST DCOST AND COMPUTE PRRFIT/D12.2 = RCOST - DCOST;
BY COUNTRY BY CAR
WHERE COUNTRY EQ '&KOUNTRY'
END
-EXIT

ira 5.3.6 aix

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


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
 
Posts: 195 | Registered: October 27, 2006Report This Post
Silver Member
posted Hide Post
PERFECT!!

Thanks, everyone. I was able to do exactly what I needed to by using both a -READ and the WHERE IN FILE.

You guys/gals are so smart :-)

Most appreciative,

Krysti


WF 767
 
Posts: 34 | Location: Chicago, IL | Registered: September 02, 2004Report This Post
Gold member
posted Hide Post
You can also set your WHERE value as a global variable (-SET &&VAR='1234'Wink and use it anytime within the session.


WF 7703M, XP/Win7, MRE, RC, BID, PMF, HTML, PDF, Excel 2000/7/10
 
Posts: 73 | Location: NY | Registered: February 06, 2007Report This Post
Virtuoso
posted Hide Post
This is nice

100 ways to get what you want

SET ASNAMES=ON
TABLE FILE DIM_PERIOD
PRINT
AGT_TERM_DT AS NEWTIME
WHERE AGT_NBR EQ '01234';
ON TABLE HOLD AS H_TIME FORMAT FOCUS INDEX AGT_TERM_DT
END
-*
Now create an inner join over the two tables DIM_PERIOD and H_TIME 
-*
-*
TABLE FILE DIM_PERIOD
SUM
NET_SALES
BY ACCT_NBR
WHERE INV_DT EQ NEWTIME;
END




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Virtuoso
posted Hide Post
and an other one

SET ASNAMES=ON
TABLE FILE DIM_PERIOD
PRINT AGT_TERM_DT
WHERE AGT_NBR EQ '01234'; 
ON TABLE HOLD AS H_TIME FORMAT ALPHA
END 
-RUN
-* 
-* 
DEFINE FILE DIM_PERIOD
SELDATA/I1=DECODE AGT_TERM_DT(H_TIME ELSE 1);
END
-* 
TABLE FILE DIM_PERIOD
SUM NET_SALES 
BY ACCT_NBR 
WHERE SELDATA EQ 0; 
END


Nice program WebFocus....




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders