home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / viscobv6.zip / vac22os2 / ibmcobol / samples / sdu / startdfm.cmd < prev    next >
OS/2 REXX Batch file  |  1995-08-03  |  7KB  |  135 lines

  1. /******************************************************************************/
  2. /* Copyright (c) IBM Corporation 1993,1995 All Rights Reserved                */
  3. /*                                                                            */
  4. /*                                                                            */
  5. /*             IBM Distributed FileManager (DFM/2) for OS/2                   */
  6. /*             ============================================                   */
  7. /*                                                                            */
  8. /*                       SAMPLE STARTUP FILE                                  */
  9. /*                                                                            */
  10. /******************************************************************************/
  11. /*                                                                            */
  12. /* DFM/2 (program no. 5648-02012)                                             */
  13. /* Version: 1.0                                                               */
  14. /* Release: 1.01                                                              */
  15. /*                                                                            */
  16. /* DISCLAIMER OF WARRANTIES:                                                  */
  17. /* The following [enclosed] code is sample code created by IBM                */
  18. /* Corporation.  This sample code is not part of any standard IBM product     */
  19. /* and is provided to you solely for the purpose of assisting you in the      */
  20. /* development of your applications.  The code is provided "AS IS",           */
  21. /* without warranty of any kind.  IBM shall not be liable for any damages     */
  22. /* arising out of your use of the sample code, even if they have been         */
  23. /* advised of the possibility of such damages.                                */
  24. /******************************************************************************/
  25. /* CHANGE ACTIVITY                                                            */
  26. /* -------------------------------------------------------------------------- */
  27. /*                           930402 Mueller  : Initial Release                */
  28. /*                           950802 W. Murphy: Release 1.011                  */
  29. /******************************************************************************/
  30. /******************************************************************************/
  31. /*                                                                            */
  32. /* Call: startdfm  [/?] | [configuration file]                                */
  33. /*                  configuration file: DFM/2 configuration file, optional    */
  34. /*                     if not specified,                                      */
  35. /*                     first the current directory is searched for config.dfm */
  36. /*                     then it is tried to use %EHNDIR%\config.dfm            */
  37. /*                                                                            */
  38. /******************************************************************************/
  39. /*                                                                            */
  40. /*                   Modify this file as needed.                              */
  41. /*                                                                            */
  42. /******************************************************************************/
  43. /* Setup  */
  44. 'echo off'
  45. UsageMsg = 'startdfm.cmd:  USAGE:  startdfm [/?] | [configuration file]'
  46.  
  47. /* Verify command line arguments */
  48. parse arg  configfile otherargs .
  49. if otherargs \= '' | configfile = '/?' | configfile = '?' | configfile = '-?' then
  50. do
  51.   say UsageMsg
  52.   exit 1
  53. end
  54.  
  55. /* Determine configuration file name. */
  56. if configfile = '' then  /* if configuration file not specified */
  57. do
  58.     /* check if configuration file exists in current directory */
  59.     xconfig = stream( '.\config.dfm' , 'Command' , 'Query Size' )
  60.     if xconfig \= '' then
  61.     do    /* configuration file is in current directory */
  62.         configfile = '.\config.dfm'
  63.     end
  64.  
  65.     /* If configuration file is not in current directory then
  66.        retrieve it from the DFM/2 product directory.          */
  67.     else
  68.     do
  69.         /* get specification of EHNDIR - DFM/2 product directory */
  70.         env = 'OS2ENVIRONMENT'
  71.         ehndir = value('EHNDIR',,env)
  72.         if ehndir = '' then
  73.         do
  74.             say 'startdfm.cmd:  Error: EHNDIR not defined - DFM/2 not started'
  75.             exit 1
  76.         end
  77.         configfile = ehndir'\config.dfm'
  78.     end
  79. end
  80.  
  81. /* Verify that configfile was found.    */
  82. 'dir ' configfile '> nul 2>nul'
  83. if rc \= '0' then
  84. do
  85.      say 'startdfm.cmd:  Error:  Configuration file not found.'
  86.      say UsageMsg
  87.      exit 1
  88. end
  89. else
  90.      say 'startdfm.cmd:  Current configuration file: ' configfile
  91.  
  92.  
  93. /* Start DFM/2 Communication Environment and Remote Stream Access Support */
  94. 'STRTDFMC' configfile
  95. if rc \= '0' then
  96. do
  97.    say 'startdfm:  Error starting DFM Stream Support.  The most likely error'
  98.    say '           is that the configuration file has not been customized'
  99.    say '           correctly or that the Communication Manager has not been'
  100.    say '           setup and started to support APPC communication.  Also'
  101.    say '           verify that you entered the correct user ID and password'
  102.    say '           and that DFM is available on the target system.'
  103.    say ' '
  104.    say '           Refer to the DFM/2 documentation and read.me file.'
  105.  
  106.    exit 1
  107. end
  108.  
  109. /* Start DFM/2 Remote Record Access Support */
  110. 'STRTDFMR' configfile
  111. if rc \= '0' then
  112. do
  113.    say 'startdfm:  Error starting DFM Record Support.  The most likely problem'
  114.    say '           is a syntax error in the configuration file.'
  115.    say ' '
  116.    say '           Refer to the DFM/2 documentation and read.me file.'
  117.    exit 1
  118. end
  119.  
  120. /* Assign drive letter(s) to the remote system(s) */
  121. /* The names behind // refer to the remote_lu names in config.dfm */
  122. say 'startdfm:  DFM Stream and Record Support has been started.  You can'
  123. say '           now assign a drive letter to the target system using the '
  124. say '           dfmdrive command or you can customize this file to assign '
  125. say '           drives automatically'
  126. /* Customize below dfmdrive command below to automatically assign drives. */
  127. /* 'CALL DFMDRIVE ASSIGN W: //MVS'      */      /* MVS System     */
  128. /* 'CALL DFMDRIVE ASSIGN X: //OS400M1'  */      /* AS/400 System M1 */
  129. /* 'CALL DFMDRIVE ASSIGN Y: //DDMCICS1' */      /* CICS/DDM System DDMCICS1 */
  130. /* 'CALL DFMDRIVE ASSIGN Z: //OS4680'   */      /* 4680 Store System */
  131.  
  132. /* Normal exit. */
  133. exit 0
  134. /**** end of file ***************************************************/
  135.