65 pts.
 Is there ANY way to use MSGID in menu source?
My current site uses a lot of custom menus, created via SDA. At present there is no way of knowing if the user's environment is live, test, development or whatever and I'd like to use a message literal to provide a header line in the top row of all menus making the environment explicit. All I could manage today was a MSGCON which obviously pulls in the literal at compile time, meaning each environment would need its own menu. If I manually add a MSGID keyword, it gets deleted when the menu is compiled. I remember this being an issue years ago. Perhaps someone reading this has found a way around it.

Software/Hardware used:
iSeries 525
ASKED: September 26, 2012  7:04 PM
UPDATED: September 26, 2012  7:05 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question. TomLiotta   110,095 pts. , ysallette1   30 pts. , brianb008   180 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

If I manually add a MSGID keyword, it gets deleted when the menu is compiled.
 
That’s right. If you compile it through the SDA menu option after making changes or simply after running through the process without changing the display image, the display source is rewritten by SDA to contain only the keywords that the option supports.
 
But you can edit the DDS for the display image (the MNUDDS member) and compile just that part as a simple DSPF.
 
You might create a ‘work’ member that holds just the MSGID() specification that you want. After compiling the menu, copy the ‘work’ member line over the top of the MSGCON() line and compile the DSPF. The menu will use that DSPF as long as its name and library are correct.
 
With a little thought, I suppose the customization steps could be automated.
 
Tom

 110,095 pts.