ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Can't Delete Physical File -- Phantom Logical

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

  • Can't Delete Physical File -- Phantom Logical

    Here's what happened:
    1) I started to do a RSTLIB
    2) Realized I had the wrong tape so I cancelled the job.
    3) I can't delete the libr because there's a file that thinks there's a logical attached to it.
    4) If I do DSPDBR on the file, it shows a dependent file, but the library name is blank.

    http://www.linkedin.com/in/chippermiller

  • #2
    Re: Can't Delete Physical File -- Phantom Logical

    Not sure but did u tried CLRLIB ?
    Thanks,

    Abhishek KUMAR

    Comment


    • #3
      Re: Can't Delete Physical File -- Phantom Logical

      Just tried it. Got this:

      Message ID . . . . . . : CPF3219 Severity . . . . . . . : 40
      Message type . . . . . : Diagnostic
      Date sent . . . . . . : 07/27/10 Time sent . . . . . . : 14:30:16

      Message . . . . : Cannot delete file or member of file CTCHDR0001 in
      BMADTATSTX.
      Cause . . . . . : If a member was referred to, the member name is *N. If
      this is a delete operation, file CTCHDR0001 in library BMADTATSTX or a
      member of file CTCHDR0001 was not deleted because dependent files or members
      are based on either the file or the member. If this is a restore operation,
      a problem occurred preventing a successful restore of file CTCHDR0001 in
      library BMADTATSTX. This problem occurred after the restore operation had
      already created the file in preparation for the load of the file's data from
      media. The restore operation was not able to delete this unsuccessfully
      restored file because dependent files or members are based on either the
      file or the member.
      http://www.linkedin.com/in/chippermiller

      Comment


      • #4
        Re: Can't Delete Physical File -- Phantom Logical

        Hi Chipper:

        I'm not sure if this will fly but give it a shot:

        1. strsql
        2. key in "drop table" and prompt (F4)
        3. Key in your physical file/library and the cascade option

        Best of Luck
        GLS
        The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

        Comment


        • #5
          Re: Can't Delete Physical File -- Phantom Logical

          Unfortunately, we don't have SQL.
          http://www.linkedin.com/in/chippermiller

          Comment


          • #6
            Re: Can't Delete Physical File -- Phantom Logical

            put the SQL statement in a source member and use RUNSQLSTM...no need for the DB2/SQL product..or you can run the SQL statement in QSHELL or...or...or.. lol

            DROP TABLE BMADTATSTX/CTCHDR0001 CASCADE
            I'm not anti-social, I just don't like people -Tommy Holden

            Comment


            • #7
              Re: Can't Delete Physical File -- Phantom Logical

              Code:
              Message ID . . . . . . : CPF3219 Severity . . . . . . . : 40
              Message type . . . . . : Diagnostic
              Date sent . . . . . . : 07/27/10 Time sent . . . . . . : 14:30:16
              
              Message . . . . : Cannot delete file or member of file CTCHDR0001 in
              BMADTATSTX.
              Cause . . . . . : If a member was referred to, the member name is *N. If
              this is a delete operation, file CTCHDR0001 in library BMADTATSTX or a
              member of file CTCHDR0001 was not deleted because dependent files or members
              are based on either the file or the member. If this is a restore operation,
              a problem occurred preventing a successful restore of file CTCHDR0001 in
              library BMADTATSTX. This problem occurred after the restore operation had
              already created the file in preparation for the load of the file's data from
              media. The restore operation was not able to delete this unsuccessfully
              restored file because dependent files or members are based on either the
              file or the member.
              that indicates that there is a logical or index in a different library that is attached to the file. have you tried using DSPDBR on the file to see what logicals are attached to it?
              I'm not anti-social, I just don't like people -Tommy Holden

              Comment


              • #8
                Re: Can't Delete Physical File -- Phantom Logical

                that indicates that there is a logical or index in a different library that is attached to the file. have you tried using DSPDBR on the file to see what logicals are attached to it?
                That's part of the problem -- DSPDBR shows the "phantom logical" -- there's no library for the logical.


                Here's what DSPDBR looks like in the production lib:
                Code:
                Files Dependent On Specified File                                     
                  Dependent File         Library       Dependency   JREF    Constraint
                      CTCHDR01           BMADTA        Data                           
                      CTCHDR02           BMADTA        Data                           
                      CTCHDR03           BMADTA        Data                           
                      CTCHDR04           BMADTA        Data                           
                      CTCHDR05           BMADTA        Data                           
                      CTCHDR06           BMADTA        Data
                Here's DSPDBR in the library where the restore got interrupted:
                Code:
                Dependent File         Library       Dependency   JREF    Constraint
                    CTCHDR04                         Data
                There's no library associated with the logical.
                Last edited by Chipper; July 27, 2010, 02:54 PM.
                http://www.linkedin.com/in/chippermiller

                Comment


                • #9
                  Re: Can't Delete Physical File -- Phantom Logical

                  Originally posted by tomholden View Post
                  put the SQL statement in a source member and use RUNSQLSTM...no need for the DB2/SQL product..or you can run the SQL statement in QSHELL or...or...or.. lol

                  DROP TABLE BMADTATSTX/CTCHDR0001 CASCADE
                  That did the trick!! THANKS, TOM!!

                  EDIT: If that didn't work, my next try was going to be RCLSTG and/or IPL. We're a 6am-6pm shop so doing that kind of stuff would not be a problem. Still, it's nice not to have to stay late.
                  Last edited by Chipper; July 27, 2010, 03:11 PM. Reason: Stuff about RCLSTG & IPL.
                  http://www.linkedin.com/in/chippermiller

                  Comment


                  • #10
                    Re: Can't Delete Physical File -- Phantom Logical

                    hehe i guess i posted the same time you did...
                    I'm not anti-social, I just don't like people -Tommy Holden

                    Comment


                    • #11
                      Re: Can't Delete Physical File -- Phantom Logical

                      Originally posted by tomholden View Post
                      hehe i guess i posted the same time you did...
                      What made it even more amusing is that the content of the "new post notification" said "then it may be hosed. i would try the SQL route (you can use RUNSQLSTM or qshell without having the SQL product) if the cascade option doesn't work then i'm outta ideas..."

                      but when I clicked "reply with quote" it said, "hehe..." -- made me do a double take for a moment.
                      http://www.linkedin.com/in/chippermiller

                      Comment


                      • #12
                        Re: Can't Delete Physical File -- Phantom Logical

                        Resurrect an old thread, but ...

                        Its the same problem. I had several files in this condition. All but 2 I deleted with SQL DROP. 2 more remain.
                        IBM says this is a known problem, solution is RCLSTG. Trying to avoid that.

                        Anyone come up with another solutiuon since 2010 ? We are at V7R1 current PTF

                        Comment


                        • #13
                          Re: Can't Delete Physical File -- Phantom Logical

                          Possibly something like RCLDBXREF would work? That might be less painful than a RCLSTG.

                          Comment


                          • #14
                            Re: Can't Delete Physical File -- Phantom Logical

                            Worth a try, but
                            Code:
                            Database Cross-Reference files successfully verified.

                            Comment


                            • #15
                              Re: Can't Delete Physical File -- Phantom Logical

                              Worth a try, but
                              Code:
                              Database Cross-Reference files successfully verified.
                              Tried this:
                              Code:
                              drop table amflibp/slqnty cascade
                              But I get this:

                              Code:
                              drop table amflibp/slqnty cascade                              
                              SLQNTY in AMFLIBP type FILE cannot be dropped with RESTRICT.

                              Comment

                              Working...
                              X