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. -carolynThis 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