dimanche 25 janvier 2015

Cobol: If statement is invalid?

I'm trying to do some data validation through a couple "If" statements, but I keep getting a Statement is invalid error and i'm not sure why..



3100-ERROR-ROUTINE.
MOVE "NO" TO ERROR-FLAG.
IF RECORD-CODE IS NOT VC
MOVE "YES" TO ERROR-FLAG
ADD 1 TO INVALID-RECORDS.
MOVE "**" TO A-AST-OUT.
MOVE "A" TO A-ERROR-OUT.
END-IF. //error here
IF VEND-NUM = SPACES OR VEND-NUM IS NOT NUMERIC
MOVE "YES" TO ERROR-FLAG.
ADD 1 TO INVALID-RECORDS.
MOVE "**" TO B-AST-OUT.
MOVE "A" TO B-ERROR-OUT.
END-IF. //error here


AST-OUT AND ERROR-OUT locations in WORKING-STORAGE Section.



01 ASTERISK-LINE.
05 A-AST-OUT PIC XX.
05 PIC X VALUE SPACES.
05 BC-AST-OUT PIC X(8).
05 PIC XX VALUE SPACES.


01 DETAIL-LINE.
05 RECORD-CODE-OUT PIC XX.
05 PIC X VALUE SPACES.
05 VEND-NUM-OUT PIC 9(8).
05 PIC XX VALUE SPACES.
05 DATE-DUE-OUT PIC X(6).
05 PIC XX VALUE SPACES.
05 VEND-NAME-OUT PIC X(20).
05 PIC XX VALUE SPACES.
05 AMT-DUE-OUT PIC XXX,XXX.XX.
05 PIC XX VALUE SPACES.
05 A-ERROR-OUT PIC X.
05 PIC XX VALUE SPACES.
05 B-ERROR-OUT PIC X.
05 PIC XX VALUE SPACES.


Thanks for your time!


Aucun commentaire:

Enregistrer un commentaire