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     EDIT Question - with IF, THEN, ELSE logic

Read-Only Read-Only Topic
Go
Search
Notify
Tools
EDIT Question - with IF, THEN, ELSE logic
 Login/Join
 
<M_RIOS75>
posted
Hello everyone, this is my question...

Background:
My date format is '01041231' where the first 2 characters indicate the century; 00=19, 01=20. In this case the date is 2004-12-31.

Problem:
I am trying to convert the date read from the launch page to this format and I keep getting FOC266. I dont know where the error is... Format from the launch page is '01/01/2007'.

Syntax:
-SET &NEW_DATE = IF (EDIT(&OLD_DATE,'999999$999') EQ '1')
THEN '00'||EDIT(&OLD_DATE,'$$$$$$$$99')||EDIT(&OLD_DATE,'99$99')
ELSE '01'||EDIT(&OLD_DATE,'$$$$$$$$99')||EDIT(&OLD_DATE,'99$99');
 
Report This Post
Expert
posted Hide Post
All dialogue manager commands must use the dash continuation character if it takes more than one line:

-SET &ECHO=ALL;
-SET &OLD_DATE = '01/01/2007';

-SET &NEW_DATE = IF (EDIT(&OLD_DATE,'999999$999') EQ '1')
- THEN '00'||EDIT(&OLD_DATE,'$$$$$$$$99')||EDIT(&OLD_DATE,'99$99')
- ELSE '01'||EDIT(&OLD_DATE,'$$$$$$$$99')||EDIT(&OLD_DATE,'99$99');
-TYPE &OLD_DATE &NEW_DATE


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
Expert
posted Hide Post
There is a little problem with the syntax of the first EDIT, you may have your 9's and your $'s reversed. If you want to compare one character to one character (the '1'), shouldn't the EDIT be EDIT(&OLD_DATE,'$$$$$$99$$')?

-SET &OLD_DATE = '01/01/2007';
-SET &A = EDIT(&OLD_DATE,'999999$999');
-TYPE &A


gives you 01/01/007.

Shouldn't the code be:
-SET &ECHO=ALL;
-SET &OLD_DATE = '01/01/2007';

-SET &NEW_DATE = IF (EDIT(&OLD_DATE,'$$$$$$99$$') EQ '19')
- THEN '00'||EDIT(&OLD_DATE,'$$$$$$$$99')||EDIT(&OLD_DATE,'99$99')
- ELSE '01'||EDIT(&OLD_DATE,'$$$$$$$$99')||EDIT(&OLD_DATE,'99$99');

-TYPE &OLD_DATE &NEW_DATE

This message has been edited. Last edited by: Francis Mariani,


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
<M_RIOS75>
posted
Thanks! I got it now..
 
Report This Post
Expert
posted Hide Post
Corrected my code above!


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
<M_RIOS75>
posted
Yea I noticed that I was pulling the wrong characters when I tried your solution. Thanks for the heads up tho!
 
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     EDIT Question - with IF, THEN, ELSE logic

Copyright © 1996-2020 Information Builders