Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

How can I check if a document already exists in a folder?

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

  • How can I check if a document already exists in a folder?

    The key to making this work is being able to read the contents of the folder in a program. (You really should be using the IFS instead of QDLS, but that is another story.) Fortunately, there is an IBM tool that will almost do that. Are you familiar with the SWEEP command? If you go to this Redbook site: http://publib-b.boulder.ibm.com/Redb...5402.html?Open you can read about the workings behind the command. The Additional material link will allow you to download a library called RPGISCOOL, which contains all of the SWEEP components. However, by default this command outputs the folder contents to a spooled file. With some simple tweaking you can output it to a database file, which you can then read and process accordingly. Dave

  • #2
    How can I check if a document already exists in a folder?

    Use the 'access' API. http://www.scottklement.com/rpg/ifs_ebook/morecmds.html Chris

    Comment


    • #3
      How can I check if a document already exists in a folder?

      Hi Dave, The redbook link that you provided took me to "Who Knew You could do that in RPG?". I searched around for 5 or 10 minutes and couldn't find any reference to the SWEEP command. Is this the right book? If so, could you help me narrow my search a bit? What chapter? What page? Thanks Joe.

      Comment


      • #4
        How can I check if a document already exists in a folder?

        the RTVDLONAM command returns the following messages: CPF8AC0 &1 command failed. CPF8AC1 Not authorized to distribution documents. CPF8A75 Not authorized to access folder &1. CPF8A77 Folder &1 not found. CPF8A82 Document &2 not found in folder &1. CPF8A83 Not authorized to access document &2 in folder &1. Sounds like you could use for checking the existance of a document. Bryan

        Comment


        • #5
          How can I check if a document already exists in a folder?

          Joe Baumgarten wrote: > The redbook link that you provided took me to "Who Knew You could do > that in RPG?". I searched around for 5 or 10 minutes and couldn't > find any reference to the SWEEP command. > > Is this the right book? If so, could you help me narrow my search a > bit? What chapter? What page? Looks like it's first mentioned as a reference in 5.7 . Bill

          Comment


          • #6
            How can I check if a document already exists in a folder?

            In a program I am creating a copy of a document by assigning a new name. But before I assign the new name I need to know if a document with that name already exists in the folder. Is there a command or API that I can use to accomplish this. I tried command CKDLO. But it monitors if document do not exists. Thanks in advance for any suggestion. Mcamejo1

            Comment


            • #7
              How can I check if a document already exists in a folder?

              mcamejo1, The CHKDLO command will send a message if the document doesn't exist, therefore if you don't get a message it does exist... See sample...
              Code

              Comment

              Working...
              X