× 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.




 Rudolf, 

        You seem to be heavy into ILE/C and I was wondering if you could 
help with a couple of issues that are causing me major grief.

        1.) I am trying to send a user journal entry (See Attached code) 
and the #%*%&$%$& thing always gives me a KEY=0 not valid error message. 
I hope I am doing something stupid here but I just can not find the 
problem with this small piece of code. 

        2.) I am trying to setup the signal handler sigkill or sigterm 
 so that when an operator does an endjob() of does a endsbs() with a 
 controled timeout some of my communications code can recognize this and
 shut down normally instead of being canceled. So, have you seen any 
 sample code that shows this, and am I looking for the right thing here.

        3.) Lastly, as I have alot of communications code up in ILE/C I 
 spend alot of time looking for input from Physical Files and Data 
 Queues, I would prefer to just add the handles to the select() and let the
 system tell me when to do IO. Have you tried anything like this and if 
 so where might I look at some sample code.

        Thanks in advance for any help you can offer, 
        Jeff Silberberg  
/******************************************************************************/

/**                                                                          
**/
/**  TESTIT - Sample Program for Send User Journal Entry                     
**/
/**                                                                          
**/
/******************************************************************************/


#include <stdio.h>
#include <string.h>
#include <qjosjrne.h>
#include <qusec.h>

         struct jeVarRecord {
            short int key;
            short int length;
            char data;
            } ;

         struct jeVarArray {
            short int count;
            char *data;           /* Insert Ptr to Array of jeVarRecords */
            } ;

main(void)
{

         Qus_EC_t errCode;

         int rc;
         char objName[10] = "SPARCSJRN" ;
         char objLibrary[10] = "*LIBL";
         char qualName[20];
         char entryData[1024];
         short int entryDataLen = 0;

         char jeRecordKey[1024];        /* Buffer to hold n jeVarRecords     */
         struct jeVarRecord *jeKey;     /* Pointer to Buffer                 */
         struct jeVarArray jeVar;       /* OverLay of the jeVarRecords Array */
         char *pJeVar;                  /* Char pointer to Struct jeVar      */

         char *pErrCode = (char *) &errCode;
         jeKey = (struct jeVarRecord *) jeRecordKey;
         memset(jeKey, 0x00, sizeof(jeRecordKey));

          jeKey->key = 2;       /* Key 2 = Qualified File Name */
          jeKey->length = sprintf(&jeKey->data, "%s%s",
                                  "$EQUIP    ", "*LIBL     ");
                       /**         1234567890    1234567890   **/
          jeKey += (jeKey->length + 4);   /* Bump Pointer by Len + 2 Shorts */

          jeKey->key = 4;       /* Key 4 = Fource Journal entry */
          jeKey->length = 1 ;
          jeKey->data = '1';
          jeKey +=  6;
                                /* Keys 1 3 5 are Defaulted    */

           jeVar.count = 2;     /* Load Arrary Count of 2 */
           jeVar.data = &jeRecordKey[0];
           pJeVar = (char *) &jeVar;

         sprintf(qualName, "%10.10s%10.10s", objName, objLibrary);
         entryDataLen = sprintf(entryData, "%s", "SHUTDOWN");

         QJOSJRNE(qualName, pJeVar, entryData, entryDataLen,
                     pErrCode);
}


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.