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     Date conversion question

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Date conversion question
 Login/Join
 
<Nathan>
posted
I am receiving cycle as parameter and want
to set value of amper variable "var" to var1 or
var2 based on whether it is current month or
not.
The cycle is passed in form of '05/2005' string
('MM/YYYY').

The following code returns syntax error message
for IF .. THEN statement.

0 ERROR AT OR NEAR LINE 25 IN PROCEDURE _ADHOCRQFOCEXEC *
(FOC266) IF .. THEN .. ELSE .. SYNTAX ERROR

I need to convert the current date properly
to alpha format ? How ?
Any other elegant solution ?

Thanks

-*===========================================
-SET &DT01 = AYMD(&YYMD,0,'I8YYMD') ;
-SET &M01 = EDIT(&DT01,'$$$$99$$') ;
-SET &Y01 = EDIT(&DT01,'9999') ;
-SET &M02 = &M01 | &Y01 ;
-SET &CURR01 = EDIT(&M02,'99/9999') ;
-*
-SET &cycle01 = &cycle; <-- Parameter received
-*
-* Following statement gives error
-*
-SET &var = IF &CURR01 EQ &cycle01
THEN 'var01' ELSE 'var02';
-TYPE &var
-EXIT
-*============================================
 
Report This Post
Silver Member
posted Hide Post
Your original di not contain a '-' on the second line of the -SET. All continued lines in Dialog Manager need a - in the first column.

You might also try:

-*===========================================
-SET &CDT = &DATEM || '/' || &DATEYY ;
-SET &DV = IF &CDT CONTAINS &CYCLE
- THEN 'V1' ELSE 'V2';

-TYPE &DV
-EXIT
-*============================================

for some reason I was getting a space at the beggining of &CDT so I changed the EQ to CONTAINS in the &DV comparison.

hth,

drew
 
Posts: 46 | Location: San Francisco, California | Registered: April 14, 2003Report This Post
Silver Member
posted Hide Post
sorry; just tried it on WebFOCUS 5.2.5 and this code:

-*===========================================
-SET &CDT = &DATEM || '/' || &DATEYY ;
-SET &DV = IF &CDT EQ &CYCLE
- THEN 'V1' ELSE 'V2';

-TYPE &DV
-EXIT
-*============================================


worked fine.

drew
 
Posts: 46 | Location: San Francisco, California | Registered: April 14, 2003Report This Post
<Nathan>
posted
Thanks Drew for your timely help.
 
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     Date conversion question

Copyright © 1996-2020 Information Builders