Focal Point
SYNTAX CHECK TOOL??

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3841020802

January 18, 2007, 10:31 AM
cbm
SYNTAX CHECK TOOL??
We run FOCUS 7.2.3 on the mainframe and I have recently been asked by a user if there are any SYNTAX CHECK TOOLs available....it would be similar to a grammer/spellcheck used by MS OFFICE apps. Evidently, this user had some code written that included the following lines:

00002 TABLE FILE D9530F15
00003 PRINT FS005 FS246
00004 IF FS005 EQ 5$$$$$
00005 IF FS246 EQ G
00006 -*IF FS005 EQ 444039 (This was indented 6 spaces to the right of the line#)
00007 END

Where line 6 was indented too far to the right, so the program read it as code rather than a comment. The error produced is as follows:


ERROR AT OR NEAR LINE 6 IN PROCEDURE CHKFCXECFOCEXEC *

(FOC002) A WORD IS NOT RECOGNIZED: -*IF

BYPASSING TO END OF COMMAND

(FOC009) INCOMPLETE REQUEST STATEMENT

The user did not recognize that being so far to the right was incorrect and was wondering if there was a program he could run first that would check his syntax before actually executing the program. I am not aware of any and have always relied on the error messages to point out my incorrect code. Thanks for any thought/ideas.
-carolyn

This message has been edited. Last edited by: cbm,
January 18, 2007, 12:01 PM
Francis Mariani
If you add SET XRETRIEVAL=OFF at the top of the program, the syntax is checked and no data is retrieved.

This command is not perfect because if you have programming code that uses -READ of HOLD files for example, the program will trigger error messages.

BTW, the comment tag -* must start in column 1 (for some reason, some people code it starting in column 2 - I think there's a subtle difference, but I don't have a clue what it is).


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
January 22, 2007, 11:19 AM
ira
old ruel for mf programs. comments should be in columns 1 or 2. No difference whether it is one or two. ira


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0