Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] dialog manager help with amper variables
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] dialog manager help with amper variables
 Login/Join
 
Silver Member
posted
Hi,

I can't seem to get the following syntax to work. I am trying to convert a term code into a year and a season. The codes are 6 characters (really all numbers). The first four represent the year and the last two represent the season (fall or spring). If the season is fall, then you need to subtract 1 from the year. If the season is spring, then you use the year "as is". So, 202020 is Spring 2020, but 202010 is Fall 2019. When I run my report I want the user to enter the term code and then I want to figure out the semester so that in my headings I can say "Spring 2020" or "Fall 2019".
In the code below, &term_season, &term_year1, and &term_year2 work fine when I -TYPE them out, but I can't get &term_year to work. I keep getting a syntax error. I've tried a bunch of things but can never get it to work. Any help would be appreciated!


-SET &term_season = IF EDIT(&term_code,'$$$$99') EQ '10' THEN 'Fall' ELSE IF EDIT(&term_code,'$$$$99') EQ '20' THEN 'Spring' ELSE 'Other';
-TYPE term_season is &term_season
-SET &term_year1 = EDIT(&term_code,'9999');
-TYPE term_year1 is &term_year1
-SET &term_year2 = &term_year1 - 1;
-TYPE term_year2 is &term_year2
-SET &term_year = IF &term_season EQ 'Fall' then &term_year2 ELSE IF &term_season EQ 'Spring' THEN &term_year1 ELSE '';
-TYPE term_year is &term_year

Here is my output:

An error has occurred

Detail:
term_season is Spring
term_year1 is 2020
term_year2 is 2019
ERROR AT OR NEAR LINE 28 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC266) IF .. THEN .. ELSE .. SYNTAX ERROR

This message has been edited. Last edited by: FP Mod Chuck,
 
Posts: 39 | Registered: March 02, 2005Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Hi leo13,

The SYNTAX ERROR is because your first then is lower case ... it needs to be THEN (Upper Case)


WebFocus 8.201M, Windows, App Studio
 
Posts: 226 | Location: Lincoln Nebraska | Registered: August 12, 2008Reply With QuoteReport This Post
Master
posted Hide Post

Agreed. The keyword THEN needs to be capitalized.

Also, I have noticed that when using DM commands, it is helpful to use the .EVAL or .QUOTEDSTRING on the parameters:

-SET &term_year = IF &term_season.EVAL EQ 'Fall' THEN &term_year2.QUOTEDSTRING ELSE IF &term_season.EVAL EQ 'Spring' THEN &term_year1.QUOTEDSTRING ELSE '';

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


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] dialog manager help with amper variables

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.