ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

creates IFS share then maps to network drive

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

  • creates IFS share then maps to network drive

    Code:
          *---------------------------------------------------------------------
          *
          *
          *---------------------------------------------------------------------
         d CmdLength       s             15  5
         d CmdString       s            256
         d InAddRemove     s              1
         d InNetDrive      s              1
         d InShareName     s             12
         d InSharePath     s             25
         d InShareText     s             25
         d MaxUsers        s             10i 0
         d PathLength      s             10i 0
         d PathCCSID       s             10i 0
         d Permission      s             10i 0
         d Q               s              1    inz('''')
         d Remove          s             10i 0
         d ShareName       s             12
         d SharePath       s           1024
         d ShareText       s             50
          *
         d APIError        ds
         d  BytesProvided                10i 0 Inz( 272 )
         d  BytesAvail                   10i 0 Inz( 0 )                              9 b
         d  MsgID                         7    Inz( *Blanks )
         d  Reserved                      1    Inz( *Blanks )
         d  MsgDta                      256    Inz( *Blanks )
          *
          * entry parameters
          *
         c     *entry        plist
         c                   parm                    InShareName
         c                   parm                    InSharePath
         c                   parm                    InShareText
         c                   parm                    InAddRemove
         c                   parm                    InNetDrive
          *
         c                   eval      PathLength = %len(%trim(InSharePath))
          *
         c                   select
         c                   when      inAddRemove = 'A'
          *
         c                   call(e)   'QZLSADFS'
         c                   parm      InShareName   ShareName
         c                   parm      InsharePath   SharePath
         c                   parm                    PathLength
         c                   parm      0             PathCCSID
         c                   parm      InShareText   ShareText
         c                   parm      2             Permission
         c                   parm      100           MaxUsers
         c                   parm                    APIError
          *
         c                   exsr      $MapNetDrive
          *
         c                   when      inAddRemove = 'R'
         c                   call(e)   'QZLSRMS'
         c                   parm      InShareName   ShareName
         c                   parm                    Remove
          *
         c                   endsl
          *
         c                   eval      *inlr = *on
          *-----------------------------------------------------
          * $MapNetDrive - Map a networkdrive
          *-----------------------------------------------------
         c     $MapNetDrive  begsr
          *
         c                   eval      cmdstring = 'STRPCO pcta(*NO)'
         c                   eval      cmdlength = %len(%trim(cmdstring))
         c                   call(e)   'QCMDEXC'
         c                   parm                    cmdstring
         c                   parm                    cmdlength
          *
          * strpccmd 'net use Z: \\lbi-nt1\SharedDocs\ProcessSchedule'
          *
         c                   eval      cmdstring = 'strpccmd ' + Q +
         c                             'net use '
         c                             + %trim(InNetDrive)
         c                             + ': \\qrockford\'
         c                             + %trim(InShareName)
         c                             + Q + ' pause(*NO)'
          *
         c                   eval      cmdlength = %len(%trim(cmdstring))
         c                   call(e)   'QCMDEXC'
         c                   parm                    cmdstring
         c                   parm                    cmdlength
         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
Working...
X