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.
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.6This message has been edited. Last edited by: Kerry,
-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.
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
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?
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.
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, 2007
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.
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, 2007
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, PoryesThis message has been edited. Last edited by: Poryes,