I'm trying to do something that should be very simple - determine the existence of Comments on Invoice Messages, just like MA66 does when it needs to determine what text to put in the Message Button on the screen. Simple, no?
I looked through the API manual to see if there was any voodoo involved - looked pretty easy. copied the code right out of MA66PD and dropped it into my program.
INITIALIZE WS-CMTMAG. MOVE SPACES TO CMTMAG-TYPE. SET CMTMAG-KFIND TO TRUE. PERFORM 900-FIND-BEGRNG-CMT-MAINVMSG. IF (CMTMAG-KFOUND) MOVE 908 TO CRT-MSG-NBR END-IF.
Failures all over the place:
43198 INITIALIZE WS-CMTMAG. * 12-S**************************************** ** ** Operand WS-CMTMAG is not declared 43199 MOVE SPACES TO CMTMAG-TYPE. * 12-S****************************************** ** ** Operand CMTMAG-TYPE is not declared 43200 SET CMTMAG-KFIND TO TRUE. * 12-S******************** ** ** Operand CMTMAG-KFIND is not declared 43202 IF (CMTMAG-KFOUND) * 12-S********************* ** ** Operand CMTMAG-KFOUND is not declared
On the surface, it looks like the library that contains these members is not getting linked in, but that should happen automatically based on the existence of PERFORM 900-FIND-BEGRNG-CMT-MAINVMSG in my PD - or have I completely misunderstood how this should work? (Or, is there something else that my program needs to contain to cause the library to be automatically linked?)
Doh!
Yep. That fixed it.