lundi 26 janvier 2015

Cobol: Comparing what's in a variable to text?

I'm attempting to do some data validation and am trying to use an if statement to see if what is in the variable ERROR-FLAG and RECORD-CODE is "NO" and "VC". Example below..



MOVE "NO" TO ERROR-FLAG.
MOVE "NO" TO ERROR-FLAG2.
IF VEND-NUM = SPACES
MOVE "YES" TO ERROR-FLAG
MOVE "********" TO BC-AST-OUT
MOVE "B" TO B-ERROR-OUT
END-IF.
IF VEND-NUM IS NOT NUMERIC AND ERROR-FLAG IS NOO
MOVE "YES" TO ERROR-FLAG
MOVE "********" TO BC-AST-OUT
MOVE "C" TO C-ERROR-OUT
END-IF.
IF RECORD-CODE IS NOT VC
MOVE "YES" TO ERROR-FLAG
MOVE "**" TO A-AST-OUT
MOVE "A" TO A-ERROR-OUT

END-IF.


NOO AND VC are defined in the working storage as "NO" and "VC" respectively. I can't seem to figure this out, any and all help is much appreciated!


Aucun commentaire:

Enregistrer un commentaire