CHKIFSOPN       CHECK IFS OPEN                         TAAIFTB

 The Check IFS Open  command provides a method of determining  if an IFS
 object is  available for a type  of use and allows a  specified type of
 sharing  with  other jobs.   If  the open  is  successful, the  file is
 closed and  the  command completes  normally.   If  the file  is  busy,
 TAA9872 is sent as an escape message.

 Note that  when the command completes,  no locks are held  on the file.
 CHKIFSOPN only lets you check before performing a function.

 UNIX open and close functions are used.

 A typical command would be:

              CHKIFSOPN    OBJ(...) OPTION(*R) SHARE(*EXCL)

 The  IFS object would  be opened for  'read only' and no  other job can
 be sharing the object.

 The defaults  for  retrying are  10  seconds for  a  delay time  and  a
 single  retry.   This means  the open  is tried  once and  if it  fails
 because the  file is in use, a wait occurs  for 10 seconds and the open
 is tried again.  If  the file is still  not available, TAA9872 is  sent
 as an error.

 If  the file  cannot  be opened  for  some other  reason  (such as  not
 authorized),   an  escape  message   occurs  immediately   without  any
 retries.

 CHKIFSOPN escape messages you can monitor for
 ---------------------------------------------

       CPFA0A9    The file does not exist
       TAA9871    Not authorized
       TAA9872    File busy
       TAA9873    Open error

 Escape messages from based on functions will be re-sent.

 Command parameters                                    *CMD
 ------------------

    OBJ           Specify  the path  name of  the object  to be checked.
                  The object path  name can be  either a simple name  or
                  a  name  that  is  qualified  with  the  name  of  the
                  directory in which the object is located.

                  A /QSYS.LIB object can be checked.

    OPTION        The  type of open to be performed.   The default is *R
                  to open the file for 'read only'.

                  *W may  be  specified  to  open the  file  for  'write
                  only'.

                  *RW may  be specified to open  the file for  'read and
                  write'.

    SHARE         The  type of sharing to  allow.  The  default is *EXCL
                  which means no other user  can be accessing the  file.

                  *SHRRD may be  specified to mean other users  may have
                  the file open for 'read only'.

                  *SHRWRT  may  be specified  to  mean  other users  may
                  have the file open for 'write only'.

                  *SHRRDWRT  may be  specified to  mean other  users may
                  have the file open for 'read and write'.

    DLYTIM        The number  of  seconds to  delay  before a  retry  is
                  attempted.   The  default is  10 seconds.    The value
                  must be in a range of 1 to 999 seconds.

                  If  DLYNBR(0)  is specified,  no retries  occur.   See
                  the DLYNBR parameter for additional information.

    DLYNBR        The number  of  retries.    The default  is  1  for  a
                  single retry.   The value must be  in a range of  1 to
                  999 retries.

                  The  number  of  retries  is  only  attempted  if  the
                  object is in use.   If the user  is not authorized  or
                  some other file  open error occurs, an  escape message
                  is sent immediately.

                  The purpose  of the DLYxxx parameters is  to allow the
                  command  to wait  a reasonable  amount of  time if the
                  file  is  in   use  to  see   if  it  can  be   opened
                  successfully.

                  If  the file  is  in  use, the  number  of retries  is
                  checked.   If it is greater  than 0, the command waits
                  for the  number of  seconds specified  for the  DLYTIM
                  parameter  and then  tries again.   Looping  continues
                  until  the number  of retries  is  exhausted.   If the
                  file is still  in use,  TAA9872 is sent  as an  escape
                  message.

 Restrictions
 ------------

 None.

 Prerequisites
 -------------

 The following TAA Tools must be on your system:

      CHKIFSE         Check IFS entry
      SNDESCINF       Send escape information
      SNDESCMSG       Send escape message

 Implementation
 --------------

 None, the tool is ready to use.

 Objects used by the tool
 ------------------------

    Object        Type    Attribute      Src member    Src file
    ------        ----    ---------      ----------    ----------

    CHKIFSOPN     *CMD                   TAAIFTB       QATTCMD
    TAAIFTBC      *PGM       CLP         TAAIFTBC      QATTCL
    TAAIFTBR      *PGM       RPGLE       TAAIFTBR      QATTRPG

Added to TAA Productivity Tools January 15, 2004


Home Page

Powered by AS/400Powered by AS/400 Last modified on January 12, 2010 © 1995, 2010 - Jim Sloan, Inc.