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] Cleaned up some code and now have a FOC 266 error...
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Cleaned up some code and now have a FOC 266 error...
 Login/Join
 
Gold member
posted
So I have this piece of code:

-SET &REPORT_ID=&FOCFOCEXEC ;
-MRNOEDIT -INCLUDE report_usage_collect
-RUN
-SET &ECHO = ALL;
SET BYDISPLAY = ON
SET ASNAMES = ON
SET HOLDLIST = PRINTONLY
-*-INCLUDE RESET_FACULTY.FEX
-DEFAULT &TERM_EVENT = 201701- 3 weeks prior to 1st Day of Class
-DEFAULT &STUDENT_TYPE = FOC_NONE

-SET &TERM1 = EDIT(&TERM_EVENT,'999999$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$');
-SET &TERM2 = &TERM1-100;
-SET &TERM3 = &TERM1-200;
-SET &EVENT = IF &TERM_EVENT CONTAINS '3 weeks prior to 1st Day of Class' THEN '3 weeks prior to 1st Day of Class' ELSE IF &TERM_EVENT CONTAINS '6 weeks prior to 1st Day of Class' THEN '6 weeks prior to 1st Day of Class' ELSE IF &TERM_EVENT CONTAINS '1st Day of Class' THEN '1st Day of Class';
-TYPE '&TERM1' '&TERM2' '&TERM3' '&EVENT'
-SET &STU_TYPE = IF &STUDENT_TYPE EQ '_FOC_NULL' THEN 'ALL' ELSE &STUDENT_TYPE;

I'm testing out a new &TERM_EVENT date and am having a heck of a time. Frowner

-SET &ECHO = ALL;
SET BYDISPLAY = ON
SET ASNAMES = ON
SET HOLDLIST = PRINTONLY
-DEFAULT &TERM_EVENT = 201809- StableDate
-DEFAULT &STUDENT_TYPE = FOC_NONE
-SET &TERM1 = EDIT(&TERM_EVENT,'999999$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$');
-SET &TERM2 = &TERM1-100;
-SET &TERM3 = &TERM1-200;
-SET &EVENT = IF &TERM_EVENT CONTAINS '3 weeks prior to 1st Day of Class' THEN '3 weeks prior to 1st Day of Class' ELSE
IF &TERM_EVENT CONTAINS '6 weeks prior to 1st Day of Class' THEN '6 weeks prior to 1st Day of Class' ELSE
IF &TERM_EVENT CONTAINS '1st Day of Late Registration' THEN '1st Day of Late Registration' ELSE
IF &TERM_EVENT CONTAINS 'StableDate' THEN 'Stable Date' ELSE
IF &TERM_EVENT CONTAINS '1st Day of Class' THEN '1st Day of Class' ELSE 'ERROR' ;
-TYPE '&TERM1' '&TERM2' '&TERM3' '&EVENT'
-SET &STU_TYPE = IF &STUDENT_TYPE EQ '_FOC_NULL' THEN 'ALL' ELSE &STUDENT_TYPE;

I get the error code

SET BYDISPLAY = ON
SET ASNAMES = ON
SET HOLDLIST = PRINTONLY
-DEFAULT &TERM_EVENT = 201809- StableDate
-DEFAULT &STUDENT_TYPE = FOC_NONE
-SET &TERM1 = EDIT(201809- StableDate,'999999$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$');
-SET &TERM2 = 201809-100;
-SET &TERM3 = 201809-200;
-SET &EVENT = IF 201809- StableDate CONTAINS '3 weeks prior to 1st Day of Class' THEN '3 weeks prior to 1st Day of Class' ELSE
0 ERROR AT OR NEAR LINE 4 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC266) IF .. THEN .. ELSE .. SYNTAX ERROR


Any thoughts?

This message has been edited. Last edited by: FP Mod Chuck,


WebFocus 8.104
Windows 7 Entreprise, SP1
 
Posts: 82 | Location: Abbotsford BC | Registered: March 15, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
quote:
-SET &EVENT = IF &TERM_EVENT CONTAINS '3 weeks prior to 1st Day of Class' THEN '3 weeks prior to 1st Day of Class' ELSE IF &TERM_EVENT CONTAINS '6 weeks prior to 1st Day of Class' THEN '6 weeks prior to 1st Day of Class' ELSE IF &TERM_EVENT CONTAINS '1st Day of Late Registration' THEN '1st Day of Late Registration' ELSEIF &TERM_EVENT CONTAINS 'StableDate' THEN 'Stable Date' ELSEIF &TERM_EVENT CONTAINS '1st Day of Class' THEN '1st Day of Class' ELSE 'ERROR' ;


Basic error, you forgot to put hypens at the beginning of every DM line, even continuations.

-SET &EVENT = IF &TERM_EVENT CONTAINS '3 weeks prior to 1st Day of Class' THEN '3 weeks prior to 1st Day of Class' ELSE 
-IF &TERM_EVENT CONTAINS '6 weeks prior to 1st Day of Class' THEN '6 weeks prior to 1st Day of Class' ELSE 
-IF &TERM_EVENT CONTAINS '1st Day of Late Registration' THEN '1st Day of Late Registration' ELSE
-IF &TERM_EVENT CONTAINS 'StableDate' THEN 'Stable Date' ELSE
-IF &TERM_EVENT CONTAINS '1st Day of Class' THEN '1st Day of Class' ELSE 'ERROR' ;


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5617 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Virtuoso
posted Hide Post
FYI (not related to your issue that Tony has already solved Smiler )
quote:
-SET &TERM1 = EDIT(&TERM_EVENT,'999999$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$');

Can be replaced by
-SET &TERM1 = EDIT(&TERM_EVENT,'999999');

Since you need to exclude everything after the 6th digit, no need to tell the function that you are skipping them.


WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2231 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Gold member
posted Hide Post
Tony thanks for the fix, I hadn't realized the hyphen in a SET command had to be applied to every line!

Martin, I'll use your code, it looks cleaner.

Thanks guys!


WebFocus 8.104
Windows 7 Entreprise, SP1
 
Posts: 82 | Location: Abbotsford BC | Registered: March 15, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
You're welcome Max.

I'll hazard a guess that most FP members have forgotten to do that a few times in their WebFOCUS days!

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5617 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Cleaned up some code and now have a FOC 266 error...

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