Alan,
   Your solution is good if I shall fail with QJOSJRNE API because it is in
   Real-Time application.
   Can you send me your CL script , because I do not know how to use CL with
   arguments
   as subroutine from ILE C ?
   Thank you,
   Zvi
   On 13/10/2017 21:51, Alan Campin wrote:
 I tried the same thing and everything I tried crashed also. What I did find
 was that I was able to do a SNDJRNE to an object path without an issue.
 Worked fine.
 May I suggest you just use ILE. Create an CL module and put your SNDJRNE in
 the CL module and bind to a C module. Lot simpler than trying to get API to
 work.
 On Mon, Oct 9, 2017 at 11:15 PM, Zvi Kave [1]<zvi.kave@xxxxxxxxxx> wrote:
    Hi Mark,
    You are right. I realized that the code I wrote crashes.
    But because it was not used actually until now, no one complained.
    I need small ILE C example to see how it worked correctly (V5R3 or
    higher).
    I am sure that the following code that I used is not good, but it is
    better if you have a working example.
    #include <stdio.h>
    #include <string.h>
    #include <qjosjrne.h>
    #include <qusec.h>
    typedef struct {
      int fillerx;
      int num_rec;
      int object_type; /* = 7 */
      int object_len;  /* = 100 - path name length */
      char *ppath;
    } JE_INFO ;
    union rec
      {
       JE_INFO je_info;
       char rbuf[256];
      };
    union rec urec;
    typedef struct {
      int ccsid; /* = 0 */
      char country_id[2]; /* = x'0000' */
      char language_id[3]; /* = x'000000' */
      char reserved3[3];
      int path_type_indicator; /* = 0 */
      int path_len;  /* = 19 */
      char path_delimiter[2]; /* = '/' */
      char reserved10[10]; /* = x'0000...00' */
      char path_name[19];
    } PATH_NAME;
    PATH_NAME path_st;
    jr_write(char *entryData)
    {
             Qus_EC_t errCode;
             int rc;
             int size;
             char objName[10]    = "MYJRN   " ;
             char objLibrary[10] = "QGPL      ";
             char qualName[20];
             short int entryDataLen = 0;
             char *pErrCode = (char *) &errCode;
             sprintf(qualName, "%10.10s%10.10s", objName, objLibrary);
    /*       entryDataLen = sprintf(entryData, "%s", "Good Luck");  */
             entryDataLen = strlen (entryData);
             urec.je_info.ppath  = (char *) &path_st.ccsid;
             urec.je_info.fillerx = 0; /* to avoid file name */
             urec.je_info.num_rec = 1;
             urec.je_info.object_type = 7;
             urec.je_info.object_len  = 51;
             path_st.ccsid = 0;
             memset (path_st.country_id, 0, 2);
             memset (path_st.language_id, 0, 3);
             memset (path_st.reserved3, 0, 3);
             path_st.path_type_indicator = 0;
             path_st.path_len = 19;
             memcpy (path_st.path_delimiter, "/ ", 2);
             memset (path_st.reserved10, 0, 10);
             memcpy (path_st.path_name,
                     "/SMZVDTA/log/av.log",
                     path_st.path_len);
             errCode.Bytes_Provided  = 0;
             errCode.Bytes_Available = 0;
             QJOSJRNE(qualName, urec.rbuf, entryData, entryDataLen,
 pErrCode);
    }
    Thanks,
    Zvi
    On 08/10/2017 18:59, Mark S Waterbury wrote:
      Zvi:
      You asked exactly the same question almost 12 years ago, on
 17-Nov-2005,
      on this very list ...  :-o
      What kind of "difficulties" are you having?  Error messages?  At
      compile-time or at run-time?  What version/release of OS/400 or IBM i?
      Perhaps if you posted  a small snippet or example of source code  to
      show what you are trying to do, then someone might be able to assist?
      Mark S. Waterbury
      > On 10/8/2017 11:05 AM, Zvi Kave wrote:
            I have dificulties to use QJOSJRNE API key 7 (with IFS path
 name)
        in
            ILE/C.
            If someone can send me an example, I shall appreciate it very
        much.
            Regards,
            Zvi
 --
 This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L)
 mailing list
 To post a message email: [2]C400-L@xxxxxxxxxxxx
 To subscribe, unsubscribe, or change list options,
 visit: [3]
https://lists.midrange.com/mailman/listinfo/c400-l
 or email: [4]C400-L-request@xxxxxxxxxxxx
 Before posting, please take a moment to review the archives
 at [5]
https://archive.midrange.com/c400-l.
References
   Visible links
   1. mailto:zvi.kave@xxxxxxxxxx
   2. mailto:C400-L@xxxxxxxxxxxx
   3. 
https://lists.midrange.com/mailman/listinfo/c400-l
   4. mailto:C400-L-request@xxxxxxxxxxxx
   5. 
https://archive.midrange.com/c400-l
 
As an Amazon Associate we earn from qualifying purchases.