ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Wrkoutqd

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

  • Wrkoutqd

    I am trying to write a CL to retrieve the IP address which WRKOUTQD displays - any thoughts would be appreciated. WRKOUTQD executes QSPDSPQD.

  • #2
    Re: Wrkoutqd

    here it is in RPG...
    Code:
          *==========================================================
          * To Compile:
          *
          *    CRTBNDRPG  PGM(XXX/RTVIPADR1)
          *
          * Function: Retrieve IP address of PC
          *
          *==========================================================
         H DFTACTGRP(*NO) BNDDIR('QC2LE')
         D RtvIpAdr        PR            20a
         D  Device                       10a   CONST
          *
         D I_Net_Adr       S             16a
          *
         D                SDS
         D  Device               244    253
          *---------------------------------------------------------
          * Retrieve IP Address
         C                   Eval      I_Net_Adr   = RtvIpAdr(Device)
         C                   Eval      I_Net_Adr   = %trim(I_Net_Adr)
    
         C     I_Net_Adr     Dsply
         C                   Eval      *Inlr = *On
          *---------------------------------------------------------
          *    RtvIpAdr - Subprocedure To Retrieve PC's IP Address
          *---------------------------------------------------------
         P RtvIpAdr        B                   Export
         D RtvIpAdr        PI            20A
         D  Inp_Device                   10A   Const
         D Apierr          DS
         D  Bytprv                 1      4B 0 Inz(216)
         D  Bytavl                 5      8B 0 Inz
         D  Errid                  9     15A   Inz
         D  Rsvd                  16     16A   Inz
         D  Errdta                17    216A   Inz
         D Net_Address     S             20A   INZ
         D Format          S              8A   Inz('DEVD0600')
         D Rcvar           S           5000A   Inz
         D Varlen          S              4B 0 Inz(5000)
         C                   Eval      Device = Inp_Device
         C                   Call      'QDCRDEVD'
         C                   Parm                    Rcvar
         C                   Parm                    Varlen
         C                   Parm                    Format
         C                   Parm                    Device
         C                   Parm                    Apierr
         C                   If        BytAvl = 0
         C                   Eval      Net_Address = %Subst(Rcvar:877:16)
         C                   Endif
         C                   Return    Net_Address
         P RtvIpAdr        E
    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


    • #3
      Re: Wrkoutqd

      crap...never mind this is for display devices.
      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: Wrkoutqd

        Thanks Jamie - I appreciate the effort. I'm still writing RPG programs (in my mind) that branch in and out of total time to execute output!

        Comment


        • #5
          Re: Wrkoutqd

          this was on one of those other sites
          I didnt test
          Code:
          DCL        VAR(&RCVAR) TYPE(*CHAR) LEN(800)                   
           DCL        VAR(&RCVLEN) TYPE(*CHAR) LEN(4)                    
           DCL        VAR(&FRMPARA) TYPE(*CHAR) LEN(20)                  
           DCL        VAR(&FMTNAM) TYPE(*CHAR) LEN(8) +                  
                        VALUE('OUTQ0100')                                
           DCL        VAR(&RMTPRTQNAM) TYPE(*CHAR) LEN(15)                
           CALL       PGM(QSPROUTQ) PARM(&RCVAR &RCVLEN &FMTNAM + 
                        &FRMPARA X'00000000')                     
           CHGVAR     VAR(&IPADR) VALUE(%SST(&RCVAR 218 15))
          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


          • #6
            Re: Wrkoutqd

            Do you have Taatool on your iseries. (Hopefully it shld be)

            there is a command RTVOUTQA which will retrieve the ip details of the associated outq. You can run below CL to get the IP addrs.
            Code:
            PGM        PARM(&OUTQNM &OUTQLIB)                                       
            DCL        VAR(&IPADDR) TYPE(*CHAR) LEN(255)     
            DCL        VAR(&OUTQNM) TYPE(*CHAR) LEN(10)      
            DCL        VAR(&OUTQLIB) TYPE(*CHAR) LEN(10)     
            TAATOOL/RTVOUTQA OUTQ(&OUTQLIB/&OUTQNM) +        
                         RMTSYSNAME(&IPADDR)                 
            SNDPGMMSG  MSG(&IPADDR)                          
            EndPgm

            Comment


            • #7
              Re: Wrkoutqd

              No TAATOOLS - which is a real bummer. However I have downloaded a program that works and creates a file of the WRKOUTQD data. Thanks all.

              Comment


              • #8
                I've written my own version of RTVOUTQD that uses the QSPROUTQ API. PM me if you want a copy.

                Comment

                Working...
                X