Unable to send messages to message subfile in RPGILE program

265 pts.
Tags:
iSeries RPG programming
RPG/400
RPGILE
I am not able to send the messages to message subfile. I am able to compile my rpgile program sucessfully... please find below displayfile and rpgile code for your reference so please advice. 

Display file:
A R MSGRCD SFL A*%%TS SD 20090407 073131 KSS991U REL-V4R4M0 5769-PW1 A SFLMSGRCD(24) A MSGKEY SFLMSGKEY A SFPGMQ SFLPGMQ(10) A R MSGCTL SFLCTL(MSGRCD) A*%%TS SD 20090407 073131 KSS991U REL-V4R4M0 5769-PW1 A OVERLAY A SFLDSP A SFLDSPCTL A N01 SFLINZ A SFLSIZ(0002) A SFLPAG(0001) A SFPGMQ SFLPGMQ(10)
RPGILE program XOP560 
 C DOW *IN03=*OFF C EXFMT PKSCR C EXSR $MSGFC C MOVEL 'XOP560' SFPGMQ C ODSTS IFEQ 'A' C MOVE 'K' ODSTS C UPDATE TFOOD00 C MOVE 'NIT0003' W@MSG C EXSR $MSGFD ************************************************************************************** ** $MSGFC : Clear Message Subfile ************************************************************************************* c $MSGFC BEGSR C CALL 'TCU999C' C PARM SFPGMQ 10 C ENDSR ************************************************************************************ ** $MSGFD : Add the Message to Message Subfile *********************************************************************************** C $MSGFD BEGSR C CALL 'TCU998C' C PARM W@MSG 7 C PARM SFPGMQ C ENDSR

Answer Wiki

Thanks. We'll let you know when a new response is added.

ok

add this C EXSR $MSGFC <– initialize message subfile

C DOW *IN03=*OFF

add this C WRITE MSGCTL <– write message subfile

C EXFMT PKSCR
C EXSR $MSGFC

Phil

//////////////////////////////////////////////////
What statement in your compile is 264???
C WRITE MSGCTL <- is this statement 0000000264

I would guess
C MOVEL ‘XOP560′ SFPGMQ needs to be before any calls to the messageq clear

so the change could have been

C MOVEL ‘XOP560′ SFPGMQ
C EXSR $MSGFC
C DOW *IN03=*OFF

C WRITE MSGCTL <– write message subfile

C EXFMT PKSCR
C EXSR $MSGFC

/////////////////////////
C MOVEL ‘XOP560′ SFPGMQ
C EXSR $MSGFC <– clears old messages
C DOW *IN03=*OFF

C WRITE MSGCTL <– displays message subfile

C EXFMT PKSCR <– displays screen
C EXSR $MSGFC <– clears message subfile
C ODSTS IFEQ ‘A’
C MOVE ‘K’ ODSTS
C UPDATE TFOOD00
C MOVE ‘NIT0003′ W@MSG <— message exists in message file?
C EXSR $MSGFD <— loads message to subfile
??? tnen endif ???
??? then enddo ???

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Askt
    program compile sucessfully while i am calling i am getting below error. Message subfile error on file XOP560FM in library NITCO. Permanent I/O error occurred in file XOP560FM. Permanent I/O error occurred in file XOP560FM (C G D F). C Permanent I/O error occurred in file XOP560FM (C G D F). C Application error. RNX1251 unmonitored by XOP560 at statement 0000000264, instruction X'0000'. Member XOP560 in file NITCO/QRPGLESRC changed with 174 records. Message . . . . : Application error. RNX1251 unmonitored by XOP560 at statement 0000000264, instruction X'0000'. Cause . . . . . : The application ended abnormally because an exception occurred and was not handled. The name of the program to which the unhandled exception is sent is XOP560 XOP560 XOP560. The program was stopped at the high-level language statement number(s) 0000000264 at the time the message was sent. If more than one statement number is shown, the program is an optimized ILE program. Optimization does not allow a single statement number to be determined. If *N is shown as a value, it means the real value was not available. Recovery . . . : See the low level messages previously listed to locate the cause of the exception. Correct any errors, and then try the request again.
    265 pointsBadges:
    report
  • Askt
    Yes. i updated changes in program. now i am able to compile sucessfully and after that i can call and exit screen without any error but error messages not displaying in screen.. please find below program for your reference.. C call 'TCU905C' PL1 C PL1 PLIST C PARM DATE1 C PARM DATE2 C PARM FRFMT C PARM TOFMT C PARM ERROR C K001 KLIST C KFLD XFDRGRF C KFLD XFINVNO C MOVEL 'XOP560' SFPGMQ NEW C EXSR $MSGFC NEW C DOW *IN03=*OFF C WRITE MSGCTL NEW C* EXSR $MSGFC C EXFMT PKSCR C EXSR $MSGFC
    265 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following