1,240 pts.
 How to Retrieve Message File
Hi, i am posting new question for how to retrive message files when i given specific *lib or *allĀ 

Software/Hardware used:
ASKED: March 14, 2012  6:24 AM
UPDATED: April 10, 2012  2:28 AM
  Help
 Approved Answer - Chosen by 9783444184 (Question Asker)

You might be interested in a series of articles I wrote about a year ago for MC Press. The last one, found here provides a search function across the message text of retrieved messages. Earlier articles (linked to by the article referenced above) demonstrate retrieving messages, changing messages, etc.

Bruce Vining

ANSWERED:  Apr 9, 2012  11:08 PM (GMT)  by 9783444184

 
Other Answers:
Last Wiki Answer Submitted:  October 16, 2012  5:54 pm  by  Michael Tidmarsh   11,410 pts.
Latest Answer Wiki Contributors:  Michael Tidmarsh   11,410 pts.
To see other answers submitted to the Answer Wiki: View Answer History.


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


 

…how to retrive message files when i given specific *lib or *all

Please describe what you mean by “retrive message files”. Do you only want to retrieve a list of message files? Or do you want to retrieve message descriptions from a message file? Or is there something else you need to do?

Tom

 108,280 pts.

 

Thanks TomLiotta,
I have creating a program in which i want to retrieve a list of message files in subfile.

 1,240 pts.

 

just like WRKMSGF command

 1,240 pts.

 

Can you tell us why you want to write a program to do that when the commands wo work with message files already exist?

 32,915 pts.

 

Well I suppose you can get a list by using DSPOBJD to an outfile.
And I’m sure Tom will have a nifty API which can also get your list.
But first, as Charlie Browne said, look at the WRKMSGF command.
Phil

 44,190 pts.

 

I probably would use the List Objects (QUSLOBJ) API to build the list, but DSPOBJD to an *OUTFILE should work fine. It can easily be tested standing alone outside of any program.

Tom

 108,280 pts.

 

Hi Sorry to all,
i m new in as400 actually i want to search a message in message file which is exist in message file or not.because some time we don’t remember message id then we add new message in message file that the problem.

if you have any idea about this please suggest me

 1,240 pts.

 

…actually i want to search a message in message file which is exist in message file or not.

That becomes much more complicated.

If you have a message file that’s small, the easiest thing to do is run this command:

DSPMSGD RANGE(*ALL) MSGF(<mymsgf>) DETAIL(*BASIC) OUTPUT(*PRINT)

Then you can search through the spooled output.

If the message file is too large, you’ll need to call a couple APIs to retrieve the attributes of each message description and to scan the text. Message descriptions can be retrieved with the Retrieve Message (QMHRTVM) API. Scanning the retrieved text for words or phrases would be done in various ways depending how you do your programming.

Tom

 108,280 pts.

 

hi thanks tom,
Do you have any sample example for because i am new in API

 1,240 pts.

 

hi All,
Please guide me qmhrtvm in api how to code please give me one sample code

 1,240 pts.

 

Hi Tom,
I have completed some part of my program in which i fetched msgfile data to physical file through qmhrtvm now i want to search text in my physical file column in that column contained msg description.

 1,240 pts.

 

…now i want to search text…

Bruce Vining’s articles in the above comment are your best direction right now. I have my own functions for this, but explanations of the code would be lengthy (and the code is lengthy enough). Since Bruce has already written excellent articles, I can’t think of a better place to look.

Tom

 108,280 pts.