RPGIV @ Work

A unique site for RPG and System i Lovers

Welcome!

Hi, this site will provide all what you need in System i and RPG developments.

My Name is Chamara Withanachchi, System i Expert and RPG Developer. And in the field for last 11 years.

I hope you will find lot of valuable information from this site

Create share on IFS folder then map to local drive on PC Print E-mail
User Rating: / 0
PoorBest 
Written by Chamara Withanachchi   

Sample from Jamie Flanary (www.code400.com)



     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-nt1SharedDocsProcessSchedule'
      *
     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
      *-----------------------------------------------------

User Comments

Please login or register to add comments

<Previous   Next>