ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Path for an object in AS400

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

  • Path for an object in AS400

    Hi, how can I found the all the path for a file, I want to copy a savf into the IFS directory with CPY or CPYTOSTMF but I need to put all the qualified name for that sav fie, such /QSYS.LIB/.../MY_LIB.LIB/MY_FILE.FILE

  • #2
    It should be just:
    /QSYS.LIB/MYLIB.LIB/MYSAVF.FILE

    You can use QSH or WRKLNK and just browse down to find it.

    A word of warning about copying your SAVF. My sure it doesn't do any type of conversion.

    Comment


    • #3
      nope, I already tried with this path /QSYS.LIB/MYLIB.LIB/MYSAVF.FILE but it doesn't work..
      I tried in this way : CPY OBJ('QSYS.LIB/MYLIB.LIB/MYSAVF.FILE') TOOBJ('/home/f.savf') -- but I receive Object not found
      Before that I verified with WRKOBJ and I have the object from MYSAVF in the library MYLIB.. so how can I found the qualified name, under what library is MYLIB.LIB with MYSAVF.file.
      All I need is to copy this savf from this library into IFS

      Comment


      • jtaylor___
        jtaylor___ commented
        Editing a comment
        Did you use QSH or WRKLINK like I suggested? What do they show?

    • #4
      I don't know how I have to use QSH or WRKLNK to find the path for an object for a sav file, I only tried with WRKOBJ and I saw that I have the object in mylib as library and the object with *file as type and attribute savf.
      please tell me how can I find those informations related to the qualified name, such where is object, under what library and under what master library such QSYS.LIB, with QSH / WRKLNK?

      Comment


      • #5
        Of course. CPY uses IFS naming, and QSH/WRKLNK allow you to browse down and get the exact IFS name for your *SAVF.

        WRKLNK:
        Prompt the WRKLNK command and for the OBJ put "/QSYS.LIB/MYLIB.LIB/*" That will give you an alpha listing of everything in your library. Page down until you find your *SAVF. The IFS name should be the "Directory" listed at the top of the screen plus the "Object link" for the specific object. I've never used CPY on a *SAVF, but that "should" be the path. Note that some file systems are case-sensitve, so best to stick with upper case.

        QSH:
        It would be the same thing as WRKLNK, just using ls to browse down.

        Comment


        • #6
          Originally posted by voicucosmin90 View Post
          nope, I already tried with this path /QSYS.LIB/MYLIB.LIB/MYSAVF.FILE but it doesn't work..
          I tried in this way : CPY OBJ('QSYS.LIB/MYLIB.LIB/MYSAVF.FILE') TOOBJ('/home/f.savf') -- but I receive Object not found
          Before that I verified with WRKOBJ and I have the object from MYSAVF in the library MYLIB.. so how can I found the qualified name, under what library is MYLIB.LIB with MYSAVF.file.
          All I need is to copy this savf from this library into IFS
          I don't see the slash in front of QSYS.LIB in your CPY command. Make sure that QSYS.LIB is preceded by a slash in the OBJ parameter: CPY OBJ('/QSYS.LIB/...')

          Comment


          • #7
            CPY OBJ('/QSYS.LIB/MYLIB.LIB/MYSAVF.FILE') TOOBJ('/home/MYDIR/MYSAVF')
            -->

            Message . . . . : Object not found. Object is
            /QSYS.LIB/MYLIB.LIB/MYSAVF.FILE.
            Cause . . . . . : Object /QSYS.LIB/MYLIB.LIB/MYSAVF.FILE, or a directory
            in the object path, could not be found, or its type cannot be resolved by
            this function.
            Recovery . . . : Correct the name or specify an object of the correct type.
            To determine if the object exists, use the Work with Object Links (WRKLNK)
            command. If the name exists, check the type of the object. If the name
            contains symbolic link objects, ensure the path names they resolve to exist.
            Retry the operation.


            WRKOBJ OBJ(*ALL/MYSAVF)
            Printscreen:
            Work with Objects

            Type options, press Enter.
            2=Edit authority 3=Copy 4=Delete 5=Display authori
            8=Display description 13=Change description

            Opt Object Type Library Attribute Text
            MYSAVF *FILE MYLIB SAVF



            --> I have the object from my savf in the MYLIB, the specified library.
            --> I have the path in the IFS



            WRKLNK OBJ('/home/MYDIR')
            Printscreen:
            Work with Object Links

            Directory . . . . : /home/MYDIR

            I understood that the streamfile MYSAVF from /home/MYDIR/MYSAVF will be created by the command.
            So, please have a look and help me if you see any issue on this. For the moment I'm not able to copy to the IFS directory and create the STMF file for this savf object

            Comment


            • #8
              I know this may be a silly question, but are you using the *real* name for the library and object when you run the command, and *NOT* MYLIB and MYSAVF?

              Walt

              Comment


              • #9
                I went thru my own instructions, and it worked like a champ.

                About I can offer now is:
                1. Double-check your spelling
                2. Have someone else try it
                3. Check PTF's
                4. Contact IBM support

                Comment

                Working...
                X