Topic
No replies
OlivierVandevoorde
OlivierVandevoorde
1 Post
ACCEPTED ANSWER

Pinned topic Custom code rules

‏2014-01-15T16:37:07Z |

Hi, I'm trying to write some custom code rule :

- IF-statement containing multiple conditions or 'NOT' must be between round brackets and maximum 4 conditions may be given

for instance CORRECT

IF    ( WS-VELD-1 = '1'

   OR  (WS-VELD-2 = '1' OR '2'))

....

IF (NOT WS-VELD-1 = '1')

- when using CALL 'CANCEL' or CALL 'PXXXZRC', it should always be preceded by a DISPLAY statement

- a working storage field which has 88-levels must always begin with SW-... and the 88 level names must contain this name

for instance :

03 SW-END-FILE PIC X(1).

88 END-FILE-YES         VALUE '1'.

88 END-FILE-NO          VALUE '0'.

- and such SW- field must always be manipulated by using SET statement instead of MOVE

SET END-FILE-YES TO TRUE

- unused fields : identification of working storage fields that aren't used in the procedure division

- constants :

- the field name must always begin with CS-

- in IF statement never use : IF (AMOUNT > 1000) but use a constant field : IF (AMOUNT > CS-MAX-AMOUNT)

I've already done a simple code rule, but didn't find how to check these cases.

 

Updated on 2014-01-15T19:20:25Z at 2014-01-15T19:20:25Z by OlivierVandevoorde