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] Adding a new value in the -PROMPT

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Adding a new value in the -PROMPT
 Login/Join
 
Gold member
posted
Hello all-

This is my first post in this forum.

My requirements is to add a value 'ALL' in the state field.

Existing code:

-PROMPT &&JATE.ENTER 4 DIGIT JOURNAL DATE(0100).
-PROMPT &&TDATE.ENTER 6 DIGIT TRANSMIT DATE(990409).
-PROMPT &&DST.ENTER 2 DIGIT STATE (OH CA FL).

As per the new requirement, I need to add the code as below

-PROMPT &&DST.ENTER 3 DIGIT STATE (OH CA ALL).

When the end user selects ST equals to ALL then need to make a
match on JDATE, TDATE

When the end user NOT selects ST equals to ALL the need to make a
match on JDATE, TDATE, ST

I have not been able to figure out exactly can do that? was hoping someone could
supply me with some specifics about the code that would be required to accomplish this task.

Best Regards,
Poryes

Focus Mainframe 7.3.6

This message has been edited. Last edited by: Kerry,
 
Posts: 64 | Registered: February 24, 2010Report This Post
Expert
posted Hide Post
-SET &ST_WHERE=IF &&DST EQ 'ALL' THEN ' ' ELSE 'put your where clause here with appropriate tick marks';
TABLE FILE filename
...
&ST_WHERE.EVAL
WHERE &&JDATE EQ ...
WHERE &&TDATE EQ ...
...
END

Also you can search the forum for EVAL to get other examples.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Guru
posted Hide Post
I apply the same technique as Ginny but instead of using empty quote marks when I don't want a where statement, I use '-*'.

 
-SET &HSSCO    = DECODE &ROUND(1 '-*'
-                              2 'WHERE CO EQ ''101'''
-                              3 'WHERE CO EQ ''104'''
-                              4 'WHERE CO EQ ''106'''
-                              5 'WHERE CO EQ ''104'''
-                              6 'WHERE CO EQ ''106''');

TABLE FILE FILENAME
PRINT FLD1
      FLD2
&HSSCO.EVAL
END
-EXIT


Works everytime!


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Virtuoso
posted Hide Post
You can also make use of my all-time favourite FOC_NONE:

-SET &DST_FILTER = IF &&DST EQ 'ALL' THEN FOC_NONE ELSE &&DST;
TABLE FILE filename
...
WHERE JOURNAL_DATE EQ &&JDATE
WHERE TRANSMIT_DATE EQ &&TDATE
WHERE DIGIT_STATE EQ &DST_FILTER
...
END


Hope that helps,
- Neftali.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
He's using mainframe FOCUS and I don't know if FOC_NONE is available there which is why I didn't recommend it in the first place. I was lazy and didn't feel like looking it up. Do you know if it is?


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
Is not mentioned in any of the Mainframe Version 7 Release 3 documentation.


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
Virtuoso
posted Hide Post
Quite honestly I am not sure. I keep forgetting that there is another world besides WebFOCUS out there. I hope I didn't end up confusing things. Frowner

- Neftali.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
Well, based on this: http://www.informationbuilders...5-1/01b_painter.html it seems like the feature is available in FOCUS:

quote:
FOCUS has a new feature that is the secret to making the ALL option work. A special keyword FOC_NONE has been added to the FOCUS language that if returned to the reporting engine will bybass the parameter and return all values for that field


I hope it indeed relates to Mainframe FOCUS since the article seems to make references to WebFOCUS and FOCUS somewhat interchangeably.

- Neftali.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
If FOC_NONE won't work, you could try this (using Neftali's example):

-SET &DST_FILTER = IF &&DST EQ 'ALL' THEN '$*' ELSE &&DST;

TABLE FILE filename
...
WHERE JOURNAL_DATE EQ &&JDATE
WHERE TRANSMIT_DATE EQ &&TDATE
WHERE DIGIT_STATE EQ '&DST_FILTER'
...
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Gold member
posted Hide Post
Thanks a lot Ginny/Glenda/Neftali/Dan.

I believe, I'm not specific with my qestion.

If end user selects ST equals to 'ALL' then make a MATCH on JDATE and TDATE to modify the table.
In other words all ST values that satisfy the match.

When the end user NOT selects ST equals to ALL the need to make a match on JDATE, TDATE, ST to modify the table.
please guide how to accomplish this task.

Thanks in advance...

Best Regards,
Poryes

Focus Mainframe 7.6.5
 
Posts: 64 | Registered: February 24, 2010Report This Post
Virtuoso
posted Hide Post
I am assuming from your explanation that columns JDATE, TDATE, and ST are all keys. If you want to MODIFY the data in the table, then the easiest method is to produce a HOLD file containing the desired key values and use the HOLD file as input to the MODIFY. Otherwise, if ST is a key and you do not provide the ST values, then you must use NEXT (and probably CASE) logic, which becomes considerably more complicated.

-PROMPT &JDATE.ENTER 4 DIGIT JOURNAL DATE(0100). 
-PROMPT &TDATE.ENTER 6 DIGIT TRANSMIT DATE(990409).
-PROMPT &DST.ENTER 3 DIGIT STATE (OH CA FL ALL).
-*
TABLE FILE filename
 BY JDATE
 BY TDATE
 BY ST
 WHERE JDATE EQ &JDATE
 WHERE TDATE EQ &TDATE
-IF &DST EQ 'ALL' GOTO SKIP_ST ;
 WHERE ST EQ '&DST'
-SKIP_ST
 ON TABLE HOLD
END
-*
MODIFY FILE filename
 FIXFORM FROM HOLD
 MATCH JDATE TDATE ST
   ON MATCH ...
   ON NOMATCH ...
 DATA ON HOLD
END

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Gold member
posted Hide Post
Sorry for my late response Dan.

I have modified the code and ran the focexec, Got the below error.

(FOC538) SU. CENTRAL AND LOCAL USERS HAVE DIFFERENT MASTER DESCRIPTIONS:
TRANSACTIONS: TOTAL = 0 ACCEPTED= 0 REJECTED= 0
SEGMENTS: INPUT = 0 UPDATED = 0 DELETED = 0

Regards,
Poryes

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


WebFOCUS 7.6.13

Mainframe
all output (Report in mainframe)
 
Posts: 64 | Registered: February 24, 2010Report 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] Adding a new value in the -PROMPT

Copyright © 1996-2020 Information Builders