ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

using Ip address to route spooled files

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

  • using Ip address to route spooled files

    We have thin clients and the users sign-on as the same id...
    for example "PLANT" I needed a way to route spooled files
    to the closest peinters to these devices. So we set hard IP
    on the thin clients then in a table we put in the IP address and
    the nearest outq (and some other ovrprtf options)
    and now using the API below we can get the interactive IP then
    route the reports as needed. In my case its barcodes.
    The other nice feature here is that if a printer is down for
    any reason we need only modify the table to route the spooled file
    to the next nearest printer.


    Code:
          //
          // Variable Definition
          //
         d Format          s              8A   Inz('DEVD0600')
         d ipaddress       s             20a
         d Rcvar           S           5000A   Inz
         d Varlen          S             10i 0 Inz(5000)
    
          //
          // Program Info
          //
         d                SDS
         d  @JOB                 244    253
    
         d APIError        ds                  Qualified
         d  BytesP                       10I 0 inz(%size(apiError))
         d  BytesA                       10I 0 inz(0)
         d  Messageid                     7
         d  Reserved                      1
         d  messagedta                  240
    
          //
          //  external called programs
          //
    
         d $getipaddress   pr                  extpgm('QDCRDEVD')
         d   rcvar                     5000
         d   varlen                      10i 0
         d   format                       8
         d   @job                        10
         d   apierror                   256
    
    
          /Free
    
            //--------------------------------------------------------
            // MAIN PROGRAM
            //--------------------------------------------------------
    
                   $getipaddress( rcvar   :
                                  varlen  :
                                  format  :
                                  @job    :
                                  Apierror
                                           );
                   ipaddress = %subst( rcvar:878:15);
                   dsply ipaddress ' ' ;
    
    
                *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
Working...
X