× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Dear all,

 

Within a C program under my AS/400, I'm trying to send messages to different
message queues.

First of all, I'm really new in C programming under OS/400, I used to work
only on Unix platform.

 

I'm using the command QMHSNDM included in a specific function called sndmsg:

 

void sndpgmmsg (char *msg_id, char *msg_data)

{

char *err_code;

char msg_key[4];

char tmp_msg_id[7];

typedef struct qual_name_struct

  {

   char  name[10];

   char  libr[10];

  } qual_name_struct;

  

qual_name_struct  MsgQList[2];  

 

strncpy(MsgQList[0].name,"PHDMSGQ   ",10);

strncpy(MsgQList[1].name,"QSYSOPR   ",10);

strncpy(MsgQList[0].libr,"PHDDTALIBS",10);

strncpy(MsgQList[1].libr,"QSYS      ",10);

 

memset(&err_code, 0, sizeof(err_code));

memcpy(tmp_msg_id, msg_id, sizeof(tmp_msg_id));

QMHSNDM(tmp_msg_id,

         "ATLMSGS   ATLPGMLIBS",

         msg_data,

         strlen(msg_data),

         "*INFO     ",

         &MsgQList,

         2,

         "",

         msg_key,

         &err_code);

}

 

When I call this function within the main() function, I have no problem,
everything is working fine.

But when I call it in an other function called by main, my program stop
without error at the call of QMHSNDM !!!

 

Do you have any idea of the problem ?

Also, I tried to find the cause of the error in the log (using dsplog) but
it says terminating with RC = 0 !!! Is there any other place to look for
errors reporting ?

 

I thank you in advance for your help.

Pierre-Henry DELIEGE




 


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.