ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

using API QWCRDRTN to view data from DTAARA

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

  • using API QWCRDRTN to view data from DTAARA

    I know the data size is hardcoded, for a few dollars I can provide a solution for this


    PHP Code:
         dQWCRDRTN         DS
         d QWCBAVL                       10i 0                                      Qwc Rdtaa Data
         d QWCBRTN                       10i 0                                      Bytes Available
         d QWCTVRTN                      10                                         Bytes Returned
         d QWCLIBN                       10                                         Type Value 
    Return
         
    d QWCLVRTN                      10i 0                                      Library Name
         d QWCNBRDP                      10i 0                                      Length returned
         d QWCVALUE                     475                                         Number Decimal
           
    //
           //
           //
         
    dQUSEC            DS
         d QUSBPRV                       10i 0
         d QUSBAVL                       10i 0
         d QUSEI                          7
         d QUSERVED                       1
         d QUSED01                        1

         drcvvarsiz        s             10i 0  inz
    (%size(QWCRDRTN))
         
    ddtaaraname       s             20    inz('IN1BSIN   LBIFIL    ')
         
    dstrpos           s             10i 0 inz(-1)
         
    dstrlen           s             10i 0 inz(%size(QWCVALUE))

          
    //
          //  Required Parameter Group:
          //
          //  1 Receiver variable Output Char(*)
          //  2 Length of receiver variable Input Binary(4)
          //  3 Qualified data area name Input Char(20)
          //  4 Starting position Input Binary(4)
          //  5 Length of data Input Binary(4)
          //  6 Error code I/O Char(*)
          //

         
    d $getdataarea    pr                  extpgm('QWCRDTAA')
         
    d   recieveVar                 475
         d   lengthRecvar                10i 0
         d   dataareaLib                 20
         d   startpositon                10i 0
         d   lengthofInp                 10i 0
         d   errorcode                   17

           
    //
           //  run the api and retrieve the data
           //  this is useful if you have same dataarea in *multiple
           //  libraries and need info from them all via RPG.
           //  just change the data in "dtaaraname" and rerun for
           //  other library/dataarea's
           //

          
    /free
                 QUSBPRV 
    0;
                 
    $getdataarea(QWCRDRTN   :
                              
    rcvvarsiz  :
                              
    dtaaraname :
                              
    strpos     :
                              
    strlen     :
                              
    QUSEC
                                         
    );

                
    // The variable QWCVALUE now contains the *DTAARA value
                 
    dsply %subst(QWCVALUE:1:30)  ' ';
                 *
    inlr = *on;

          /
    end-free

    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

  • #2
    Re: using API QWCRDRTN to view data from DTAARA

    No CL or binary fields?
    Michael Catalani
    IS Director, eCommerce & Web Development
    Acceptance Insurance Corporation
    www.AcceptanceInsurance.com
    www.ProvatoSys.com

    Comment


    • #3
      Re: using API QWCRDRTN to view data from DTAARA

      You know there was binary in there, right b4 I posted... I took it out so as not to get a talkin to

      jamie
      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

      Working...
      X