ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

help SNDMSGWAIT TomHolden Tool

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • help SNDMSGWAIT TomHolden Tool

    I have downloaded the tool in title but i am not able to run it;
    i have created the TTLIB but i think in the TTLIB should be a usrspc named SNDMSGWAIT . I can create it. Is there some one that can give me information. In the savf i found only source

    sorry and thanks in advance

  • #2
    Re: help SNDMSGWAIT TomHolden Tool

    just create the user space and compile and run the ADDMSGNEP RPGLE program to add the initial entry used by the process.
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: help SNDMSGWAIT TomHolden Tool

      this thing creates a space just pluck out the useless code

      Code:
            *===================================================
      
            * PROGRAM - @@SPACE
            * PURPOSE - dump objects (DSPOBJD) to userspace
            * WRITTEN -
            * AUTHOR  - jamie flanary
            *
            * PROGRAM DESCRIPTION
            *   This program will dump objects into a userspace
            *
            *
            * INPUT PARAMETERS
            *   Description        Type  Size    How Used
            *   -----------        ----  ----    --------
            *   InLibary           Char  10      Library to search for objects
            *   InType             Char  10      Type of objects to dump
            *
            * INDICATOR USAGE
            *   03 - Cancel current screen and return to previous screen
            *   30 - SFLCLR
            *   31 - SFLDSP
            *   32 - SFLDSPCTL
            *   33 - SFLEND
            *
            *===================================================
            *
            * Program Info
            *
           d                SDS
           d  @PGM                   1     10
           d  @PARMS                37     39  0
           d  @JOB                 244    253
           d  @USER                254    263
           d  @JOB#                264    269  0
            *
            *  Field Definitions.
            *
           d AllText         s             10    Inz('*ALL')
           d CmdString       s            256
           d CmdLength       s             15  5
           d Count           s              4  0
           d Format          s              8
           d GenLen          s              8
           d InLibrary       s             10
           d InType          s             10
           d ObjectLib       s             20
           d SpaceVal        s              1    inz(*BLANKS)
           d SpaceAuth       s             10    inz('*CHANGE')
           d SpaceText       s             50    inz(*BLANKS)
           d SpaceRepl       s             10    inz('*YES')
           d SpaceAttr       s             10    inz(*BLANKS)
           d UserSpaceOut    s             20
      À     *                                                                                            Ä
      À     * GenHdr                                                                                     Ä
      À     *                                                                                            Ä
           d GenHdr          ds                  inz
           d  OffSet                 1      4B 0
           d  NumEnt                 9     12B 0
           d  Lstsiz                13     16B 0
      À     *                                                                                            Ä
      À     *  Data structures                                                                           Ä
      À     *                                                                                            Ä
           d GENDS           ds
           d  OffsetHdr              1      4B 0
           d  NbrInList              9     12B 0
           d  SizeEntry             13     16B 0
            *
            *
            *
           d HeaderDs        ds
           d  OutFileNam             1     10
           d  OutLibName            11     20
           d  OutType               21     25
           d  OutFormat             31     40
           d  RecordLen             41     44B 0
      
            *
            * API Error Data Structure
            *
           d ErrorDs         DS                  INZ
           d  BytesPrv               1      4B 0
           d  BytesAvl               5      8B 0
           d  MessageId              9     15
           d  ERR###                16     16
           d  MessageDta            17    116
            *
            * Create userspace datastructure
            *
           d                 DS
           d  StartPosit             1      4B 0
           d  StartLen               5      8B 0
           d  SpaceLen               9     12B 0
           d  ReceiveLen            13     16B 0
           d  MessageKey            17     20B 0
           d  MsgDtaLen             21     24B 0
           d  MsgQueNbr             25     28B 0
            *
            * Date structure for retriving userspace info
            *
           d InputDs         DS
           d  UserSpace              1     20
           d  SpaceName              1     10
           d  SpaceLib              11     20
           d  InpFileLib            29     48
           d  InpFFilNam            29     38
           d  InpFFilLib            39     48
           d  InpRcdFmt             49     58
            *
           d ObjectDs        ds
           d  Object                       10
           d  Library                      10
           d  ObjectType                   10
           d  InfoStatus                    1
           d  ExtObjAttrib                 10
           d  Description                  50
      À     *                                                                                            Ä
            *  Create a userspace
            *
           c                   exsr      $QUSCRTUS
            *
           c                   eval      ObjectLib =  AllText + InLibrary
            *
            * List all the objects to the user space
            *
           c                   eval      Format = 'OBJL0200'
            *
           c                   call(e)   'QUSLOBJ'
           c                   parm      Userspace     UserSpaceOut
           c                   parm                    Format
           c                   parm                    ObjectLib
           c                   parm                    InType
            *
            * Retrive header entry and process the user space
            *
           c                   eval      StartPosit = 125
           c                   eval      StartLen   = 16
            *
            * Retrive header entry and process the user space
            *
           c                   call      'QUSRTVUS'
           c                   parm      UserSpace     UserSpaceOut
           c                   parm                    StartPosit
           c                   parm                    StartLen
           c                   parm                    GENDS
            *
           c                   eval      StartPosit = OffsetHdr + 1
           c                   eval      StartLen = %size(ObjectDS)
            *
            *
      À     *  Do for number of fields                                                                   Ä
            *
      B1   c                   do        NbrInList
            *
           c                   call(e)   'QUSRTVUS'
           c                   parm      UserSpace     UserSpaceOut
           c                   parm                    StartPosit
           c                   parm                    StartLen
           c                   parm                    ObjectDs
            *
           c                   eval      StartPosit = StartPosit + SizeEntry
           c                   enddo
            *
           c                   eval      *Inlr = *On
            *===============================================
            * $QUSCRTUS - API to create user space
            *===============================================
           c     $QUSCRTUS     begsr
            *
            * Create a user space named ListObjects in QTEMP.
            *
           c                   Eval      BytesPrv = 116
           c                   movel(p)  'LISTOBJECTS' SpaceName
           c                   movel(p)  'QTEMP'       SpaceLib
            *
            * Create the user space
            *
           c                   call(e)   'QUSCRTUS'
           c                   parm      UserSpace     UserSpaceOut
           c                   parm                    SpaceAttr
           c                   parm      4096          SpaceLen
           c                   parm                    SpaceVal
           c                   parm                    SpaceAuth
           c                   parm                    SpaceText
           c                   parm                    SpaceRepl
           c                   parm                    ErrorDs
            *
           c                   endsr
            *=================================================
            *    *Inzsr - One time run House keeping subroutine
            *=================================================
           c     *Inzsr        begsr
            *
           c     *entry        plist
           c                   parm                    InLibrary
           c                   parm                    InType
            *
           c                   endsr
            *==============================================
      Attached Files
      All my answers were extracted from the "Big Dummy's Guide to the As400"
      and I take no responsibility for any of them.

      www.code400.com

      Comment


      • #4
        Re: help SNDMSGWAIT TomHolden Tool

        better yet just create a command object:
        Code:
                     CMD        PROMPT('Create User Space')
                     PARM       KWD(USRSPC) TYPE(Q1) MIN(1) PROMPT('User +
                                  Space:')
                     PARM       KWD(EXTATR) TYPE(*CHAR) LEN(10) DFT(*DFT) +
                                  SPCVAL((*DFT 'USRSPC')) PROMPT('Extended +
                                  Attributes:')
                     PARM       KWD(INITSIZE) TYPE(*INT4) DFT(1024) +
                                  PROMPT('Initial Size:')
                     PARM       KWD(INITVALUE) TYPE(*CHAR) LEN(1) DFT(X'00') +
                                  PROMPT('Initial Value:')
                     PARM       KWD(PUBLICAUTH) TYPE(*CHAR) DFT(*ALL) +
                                  PROMPT('Public Authority:')
                     PARM       KWD(DESC) TYPE(*CHAR) LEN(50) DFT('User +
                                  Space') PROMPT('Description:')
                     PARM       KWD(REPLACE) TYPE(*CHAR) LEN(10) RSTD(*YES) +
                                  DFT(*NO) VALUES(*YES *NO) PROMPT('Replace:')
                     PARM       KWD(ERROR) TYPE(*CHAR) LEN(512) +
                                  PROMPT('Error Code:')
         Q1:         QUAL       TYPE(*NAME) LEN(10)
                     QUAL       TYPE(*NAME) LEN(10) SPCVAL((*LIBL) +
                                  (*CURLIB)) PROMPT('Library:')
        the CPP would be the QUSCRTUS API
        I'm not anti-social, I just don't like people -Tommy Holden

        Comment


        • #5
          Re: help SNDMSGWAIT TomHolden Tool

          Now it seem Ok; but i have two question:
          1- How can reply to the message that i retrive with
          SNDMSGWAIT ? (ex. record locked i would reply with 'C' and
          also send a message to the user that keep locked the record
          and/or end his job; can i find example of this ??)
          2- From the moment i would read the MSGW with SNDMSGWAIT
          until the job is in status MSGW i changed SNDMSGWAIT when
          read QSYSOPR :
          RcvNonPgmMsg( OutputData
          : OutputDataLength
          : 'RCVM0200'
          : 'QSYSOPR *LIBL'
          : '*INQ'
          : *BLANK
          : 0
          : '*SAME' <========= before was *OLD
          : ErrorDS );
          but a strange think happen : the msg some time came read 3 or 4 o 5 time and then stop, it seem that some other user/program read that message and flag it as not to be read more .
          Any ideas, how can i find who read the messagge ??

          thanks in advance

          Comment


          • #6
            Re: help SNDMSGWAIT TomHolden Tool

            Originally posted by gio.cot View Post
            Now it seem Ok; but i have two question:
            1- How can reply to the message that i retrive with
            SNDMSGWAIT ? (ex. record locked i would reply with 'C' and
            also send a message to the user that keep locked the record
            and/or end his job; can i find example of this ??)
            2- From the moment i would read the MSGW with SNDMSGWAIT
            until the job is in status MSGW i changed SNDMSGWAIT when
            read QSYSOPR :
            RcvNonPgmMsg( OutputData
            : OutputDataLength
            : 'RCVM0200'
            : 'QSYSOPR *LIBL'
            : '*INQ'
            : *BLANK
            : 0
            : '*SAME' <========= before was *OLD
            : ErrorDS );
            but a strange think happen : the msg some time came read 3 or 4 o 5 time and then stop, it seem that some other user/program read that message and flag it as not to be read more .
            Any ideas, how can i find who read the messagge ??

            thanks in advance
            that is correct, normal behavior *OLD leaves the message on the msgq and flags it as "old" so when the NEP executes the procedure again it's NOT sent repeatedly!(why would you want to receive a notification for the same message over and over again??) changing that value to *SAME will allow the program to retrieve and notify you repeatedly UNTIL the message is replied to (once the message is replied to you won't be notified again regardless). this tool is used to monitor for MSGW and notify you there is a MSGW. you still have to wrkmsg qsysopr and reply to the message!!! this is a NOTIFICATION tool, nothing more, nothing less!

            as far as who read the message, no clue how you would find out that information, if a default reply is defined for the message and the system reply list is being used then the system will automatically reply to the message with no user intervention.
            I'm not anti-social, I just don't like people -Tommy Holden

            Comment


            • #7
              Re: help SNDMSGWAIT TomHolden Tool

              Ok Tom regard *OLD/*SAME you are right i was in mistake. For the :
              1- How can reply to the message that i retrive with
              SNDMSGWAIT ? (ex. record locked i would reply with 'C' and
              also send a message to the user that keep locked the record
              and/or end his job; can i find example of this ??)


              do you have any suggestion ??

              thanks for you reply

              Comment


              • #8
                Re: help SNDMSGWAIT TomHolden Tool

                Originally posted by gio.cot View Post
                Ok Tom regard *OLD/*SAME you are right i was in mistake. For the :
                1- How can reply to the message that i retrive with
                SNDMSGWAIT ? (ex. record locked i would reply with 'C' and
                also send a message to the user that keep locked the record
                and/or end his job; can i find example of this ??)


                do you have any suggestion ??

                thanks for you reply
                read the last 2 sentences of my previous reply again
                I'm not anti-social, I just don't like people -Tommy Holden

                Comment


                • #9
                  Re: help SNDMSGWAIT TomHolden Tool

                  Sorry Tom i have not read with attention yuou reply;

                  now i have to look for to understand which other pgm read the qsysopr because also this morning i have the following message:

                  ID Msg . . . . . : RNQ0202
                  Date send . . . . : 19/12/09
                  Msg Type . . . . : Inquiry
                  From . . . . . . . . : VSIOWNER

                  From Job . . . . . . . . . . : ODS_EXCEPT
                  User . . . . . . . . . . . : VSIOWNER
                  Number . . . . . . . . . . . : 701150


                  that SNDMSGWAIT has not read. If not all message from qsysopr came read from SNDMSGWAIT i have to find other solution.

                  Thanks

                  Comment


                  • #10
                    Re: help SNDMSGWAIT TomHolden Tool

                    Originally posted by gio.cot View Post
                    Sorry Tom i have not read with attention yuou reply;

                    now i have to look for to understand which other pgm read the qsysopr because also this morning i have the following message:

                    ID Msg . . . . . : RNQ0202
                    Date send . . . . : 19/12/09
                    Msg Type . . . . : Inquiry
                    From . . . . . . . . : VSIOWNER

                    From Job . . . . . . . . . . : ODS_EXCEPT
                    User . . . . . . . . . . . : VSIOWNER
                    Number . . . . . . . . . . . : 701150


                    that SNDMSGWAIT has not read. If not all message from qsysopr came read from SNDMSGWAIT i have to find other solution.

                    Thanks
                    looks like you are running Vision HA software. since their programs lock the message queue, either they have a comparable tool you aren't aware of or you're out of luck...VSIOWNER is the default owner of Vision HA objects. Contact your representative or support line for that product and see if there is already something in the package you can use.
                    I'm not anti-social, I just don't like people -Tommy Holden

                    Comment


                    • #11
                      Re: help SNDMSGWAIT TomHolden Tool

                      Hi Tommy...i have a problem here while compiling SNDMSGWAIT...it says RVTSYAVAL not found in QCOPYSRC....
                      there are some member not found in QCOPYSRC funtion_, centerit..etc...i update the oncall PF with SQL update for email id and oncall 'Y'

                      I wish to recompile this to remove the 'DBS' and 'DBS@xxxxxxxxxxxxxx.COM' and insert my server name...
                      I am on V5R4M0...wondering if you please help me in this.....

                      Thanks
                      Last edited by jamief; August 7, 2011, 08:43 AM. Reason: took out domain

                      Comment


                      • #12
                        Re: help SNDMSGWAIT TomHolden Tool

                        it says RVTSYAVAL not found in QCOPYSRC....
                        I'm sure you meant RTVSYSVAL, not RTVSYAVAL?
                        â??No bird soars too high if he soars with his own wingsâ?? â?? William Blake

                        Comment


                        • #13
                          Re: help SNDMSGWAIT TomHolden Tool

                          Yes it did mean that its a spelling mistake.

                          Comment

                          Working...
                          X