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     [SOLVED] (FOC283) IMPROPER USE OF 'GOTO'

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] (FOC283) IMPROPER USE OF 'GOTO'
 Login/Join
 
Silver Member
posted
Greetings all,

I'm having a problem receiving the (FOC283) IMPROPER USE OF 'GOTO' error and I'm not seeing a reason. Below is the code along with where the where it is showing the error. We are running 7.3.4 on the mainframe with MVS, TSO, and DB2. Any assistance would be greatly apreciated.
-SET &ECHO=ALL;                                                      
DYNAM ALLOC FILE DTFILE DA D.WIP.WHS.DATE.FILE SHR REUSE             
-RUN                                                                 
-READ DTFILE &CYY.A4. &CMM.A2. &CDD.A2. &FIL.A8. &CFY.A4. &DFY.A4.   
-SET &CURDT = &CMM | '/' | &CDD | '/' | &CYY;                        
-IF &demand = 'M' THEN GOTO MONTHLY;                                 
-** YEARLY                                                           
-SET &LFY = ASIS(&CFY) - 1;                                          
-SET &BDT = &LFY | '-07-01';                                         
-SET &EDT = &CFY | '-06-30';                                         
-GOTO HEADSET                                                        
-MONTHLY                                                             
-SET &LMM = IF ASIS(&CMM) - 1 EQ 0 THEN '12' ELSE                    
-  IF ASIS(&CMM) - 1 EQ 11 THEN '11' ELSE                            
-  IF ASIS(&CMM) - 1 EQ 10 THEN '10' ELSE                            
-  IF ASIS(&CMM) - 1 EQ 10 THEN '10' ELSE                            
-  IF ASIS(&CMM) - 1 EQ 9 THEN '09' ELSE                             
-  IF ASIS(&CMM) - 1 EQ 8 THEN '08' ELSE                                
-  IF ASIS(&CMM) - 1 EQ 7 THEN '07' ELSE                                
-  IF ASIS(&CMM) - 1 EQ 6 THEN '06' ELSE                                
-  IF ASIS(&CMM) - 1 EQ 5 THEN '05' ELSE                                
-  IF ASIS(&CMM) - 1 EQ 4 THEN '04' ELSE                                
-  IF ASIS(&CMM) - 1 EQ 3 THEN '03' ELSE                                
-  IF ASIS(&CMM) - 1 EQ 2 THEN '02' ELSE                                
-  IF ASIS(&CMM) - 1 EQ 1 THEN '01' ELSE ' ';                           
-SET &LYY = IF &CMM EQ '12' THEN ASIS(&CYY) - 1 ELSE &CYY;              
-SET &BDT = &LYY || '-' | &LMM || '-01';                                
-SET &LDD =                                                             
-  DECODE '&LMM'('01' '31', '02' '28', '03' '31', '04' '30', '05' '31', 
-                '06' '30', '07' '31', '08' '31', '09' '30', '10' '31', 
-                '11' '30', '12' '31');                                 
-SET &LDD = IF &LMM EQ '02' AND (&LYY EQ '2012' OR &LYY EQ '2016' OR    
-  &LYY EQ '2020' OR &LYY EQ '2024') THEN '29' ELSE &LDD;               
-SET &EDT = &LYY || '-' | &LMM || '-' | &LDD;                           
-HEADSET                                                       
-SET &HEAD1 = 'Pre-Audit Invoice Summary';                     
-SET &HEAD2 =  &BDT |' to '| &EDT;                             
-SET &FLAIR = 'Y';                                             
-SET &MFMP = 'Y';                                              
-SET &PCARD = 'Y';                                             
-SET &PREAUD = 'Y';                                            
-SET &WHERE1 = 'WHERE POSTING_DT GE '|''''|&BDT||''''|' AND '  
-  |'POSTING_DT LE '|''''|&EDT||''''|';';                      
-SET &FLGT = 'Y';                                              
-SET &FLLT = 'Y';                                              
-SET &MFGT = 'Y';                                              
-SET &MFLT = 'Y';                                              
-**                                              

  FOCUS  7.3.4   09.26.52  05/16/2012  PREADSUM  LINE   9  6395.07     
                                                                       
 DYNAM ALLOC FILE DTFILE DA D.WIP.WHS.DATE.FILE SHR REUSE              
-READ DTFILE &CYY.A4. &CMM.A2. &CDD.A2. &FIL.A8. &CFY.A4. &DFY.A4.     
-SET &CURDT = 05 | '/' | 15 | '/' | 2012;                              
-IF M = 'M' THEN GOTO MONTHLY;                                         
-MONTHLY                                                               
-SET &LMM = IF ASIS(05) - 1 EQ 0 THEN '12' ELSE                        
-  IF ASIS(05) - 1 EQ 11 THEN '11' ELSE                                
-  IF ASIS(05) - 1 EQ 10 THEN '10' ELSE                                
-  IF ASIS(05) - 1 EQ 10 THEN '10' ELSE                                
-  IF ASIS(05) - 1 EQ 9 THEN '09' ELSE                                   
-  IF ASIS(05) - 1 EQ 8 THEN '08' ELSE                                   
-  IF ASIS(05) - 1 EQ 7 THEN '07' ELSE                                   
-  IF ASIS(05) - 1 EQ 6 THEN '06' ELSE                                   
-  IF ASIS(05) - 1 EQ 5 THEN '05' ELSE                                   
-  IF ASIS(05) - 1 EQ 4 THEN '04' ELSE                                   
-  IF ASIS(05) - 1 EQ 3 THEN '03' ELSE                                   
-  IF ASIS(05) - 1 EQ 2 THEN '02' ELSE                                   
-  IF ASIS(05) - 1 EQ 1 THEN '01' ELSE ' ';                              
-SET &LYY = IF 05 EQ '12' THEN ASIS(2012) - 1 ELSE 2012;                 
-SET &BDT = 2012 || '-' | 04 || '-01';                                   
-SET &LDD =                                                              
-  DECODE '04'('01' '31', '02' '28', '03' '31', '04' '30', '05' '31',    
-                '06' '30', '07' '31', '08' '31', '09' '30', '10' '31',  
-                '11' '30', '12' '31');                                  
(FOC283) IMPROPER USE OF 'GOTO'                                            


Thank you.

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


7.7, z/OS & Win7, excel & pdf
8.2 testing
 
Posts: 46 | Location: Tallahassee, FL ... was focused on, uh, what were we talking about? | Registered: February 03, 2012Report This Post
Silver Member
posted Hide Post
I should add that in my current testing, &demand is set to M. This is being passed in from the JCL.


7.7, z/OS & Win7, excel & pdf
8.2 testing
 
Posts: 46 | Location: Tallahassee, FL ... was focused on, uh, what were we talking about? | Registered: February 03, 2012Report This Post
Virtuoso
posted Hide Post
quote:
-IF &demand = 'M' THEN GOTO MONTHLY;

Shouldn't that be?:
-IF &demand EQ 'M' THEN GOTO MONTHLY;


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
BGronli,

I would change this:
  
-IF &demand = 'M' THEN GOTO MONTHLY;  
to
-IF '&demand.EVAL' EQ 'M' GOTO MONTHLY;  

There may be another -GOTO, but, don't see it. It may be due to the DECODE, always end with a default value:
  
-SET &LDD =                                                              
-  DECODE '&LMM.EVAL'('01' '31', '02' '28', '03' '31', '04' '30', '05' '31',    
-                '06' '30', '07' '31', '08' '31', '09' '30', '10' '31',  
-                '11' '30', '12' '31' ELSE 'XX');                                  



Also, as an aside, to check for a leap year, instead of hard-coding, this will work for you:

  
-SET &LEAP_YR1 = (&FY / 4) * 100;
-SET &LEAP_YR2 = EDIT(&LEAP_YR1,'$$$99');
-SET &LEAP_YR3 = IF &LEAP_YR2 EQ '00' THEN 'February 29 ' ELSE 'February 28 ';
-SET &X_MONTH  = DECODE &FP (
-                 01 'July 31 '
-                 02 'August 31 '
-                 03 'September 30 '
-                 04 'October 31 '
-                 05 'November 30 '
-                 06 'December 31  '
-                 07 'January 31 '
-                 08 '&LEAP_YR3.EVAL'
-                 09 'March 31 '
-                 10 'April 30 '
-                 11 'May 31 '
-                 12 'June 30 '
-                 13 'June 30 '
-                 14 'June 30 '
-               ELSE ' ');

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
I gather the first code listing is the focexec file, and the second is a an MVS FOCUS run-time listing.

Fix the following:

1. Use of "=" in place of "EQ" is non-standard.
Change
-IF &demand = 'M' THEN GOTO MONTHLY;
to
-IF &demand EQ 'M' THEN GOTO MONTHLY;

2. There are ASIS()'s liberally sprinkled throughout, as in

-SET &LFY = ASIS(&CFY) - 1;

They are extraneous, and may cause problems. All you need is
-SET &LFY = &CFY - 1;

3. FOC238 is sometimes generated in a -SET if there is a problem parsing a decode or if-then-else structure.
Here's what's causing the error message:

-SET &LDD =
- DECODE '&LMM'('01' '31', '02' '28', '03' '31', '04' '30', '05' '31',
- '06' '30', '07' '31', '08' '31', '09' '30', '10' '31',
- '11' '30', '12' '31');

The apostrophes surrounding &LMM are not called for (Dialog Manager knows that amper vars contain character strings); remove them.

Also, as a rule always provide a default ("ELSE ...") in your DECODEs.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Silver Member
posted Hide Post
Thanks for the replies. I will give these suggestions a try let you all know.


7.7, z/OS & Win7, excel & pdf
8.2 testing
 
Posts: 46 | Location: Tallahassee, FL ... was focused on, uh, what were we talking about? | Registered: February 03, 2012Report This Post
Silver Member
posted Hide Post
Thanks again. I made teh changes suggested and am now getting farther along than what was shown above.


7.7, z/OS & Win7, excel & pdf
8.2 testing
 
Posts: 46 | Location: Tallahassee, FL ... was focused on, uh, what were we talking about? | Registered: February 03, 2012Report This Post
Expert
posted Hide Post
fyi IMPROPER USE OF GOTO doesn't actually mean what it says...so don't take it too seriously...you can get that error when you don't have a single GOTO in your code...its often just a signal that somethin' ain't right.
Its a TSHIRT slogan... Smiler




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report 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     [SOLVED] (FOC283) IMPROPER USE OF 'GOTO'

Copyright © 1996-2020 Information Builders