IBM Support

QSHELL 001-0019 No Such Path or Directory

Technote (troubleshooting)


Problem(Abstract)

This document provides several possible reasons why message QSH 001-0019: "No such path or directory" is received on all QSHELL commands.

Resolving the problem

This document provides several possible reasons why message QSH 001-0019: "No such path or directory" is received on all QSHELL commands.

Commands (for example: java, ls, or pwd) in QSHELL receive the following message:

qsh: 001-0019 Error found searching for command XXXXXX. No such path or directory.

There are several possible reasons for this message, so the following should help to determine the problem.

To determine if QSHELL commands are working, have the user go into QSHELL and type ls. Does this fail with the QSH 001-0019?

    • - How to do this:



      On the CL command line, type qsh, and press the Enter key.
      On the next screen, type ls, and press the Enter key. (This displays all the files in the home directory set for this session.)

      • - Yes



        Go into QSHELL, and type /usr/bin/ls

          • - How to do this:



            On a the operating system command line, type the following, and press the Enter key: qsh
            This takes you to the qsh command entry screen.
            On the command line, type the following and press the enter key: /usr/bin/ls
            Does it display files?



          • - Yes



            Possible Solution:
            The PATH system environment variable has been added, and /usr/bin: is not listed.
            On the operating system command line, type the following, and press the Enter key: WRKENVVAR LEVEL(*SYS) or WRKENVVAR LEVEL(*JOB)
            Determine if the PATH variable exists (must be all capital letters).
            If it does, ensure /usr/bin: is in the value.
            If not, select Option 2 to change and add :/usr/bin: (the colon is the separator between entries).

              • - Did not resolve the issue



                The QSHELL commands are on the system in the /usr/bin directory; however, the path to the commands is not defined correctly. The system searches in the path pointer by the environment variable PATH (search path for commands). In the QSHELL, type command /usr/bin/env to display the path this session is using.

                Example of the listing for the env command:

                MACHTYPE=powerpc-ibm-os400
                TERMINAL_TYPE=5250
                HOME=/home/XXXXXX
                PATH=/usr/bin: <== Note: This is the path that QSHELL will look for its commands.

                If the PATH does not have /usr/bin:, it must be set.
                Use one of the following methods: a profile file (two locations), in a program, or system environment variable

                  • - Profile file explanation



                    Global profile file
                    If the file /etc/profile exists, qsh runs it in the current environment when you log in.
                    It is typically maintained by an administrator to set system-wide defaults for all users.
                    This file should be secured by setting the public authority to READ and EXECUTE.
                    Following is a sample /etc/profile file:
                    # Sample /etc/profile file
                    export PATH=$PATH:/usr/bin: ($PATH indicates insert the current PATH setting.)

                    Profile file
                    If the file .profile exists in the user's home directory, qsh runs it in the current environment when you log in.
                    It is used to customize your login environment.
                    Note: Home directory is defined in the user profile. If the location does not exist, it defaults to the root of the Integrated File System.
                    Following is a sample .profile file.
                    # Sample .profile file
                    export ENV=$HOME/.qshrc
                    export PATH=$PATH:$HOME/bin ($PATH indicates to insert the current PATH setting.)

                    • - Program



                      In the program, insert this command:
                      export PATH=$PATH:/usr/bin: ($PATH indicates to insert the current PATH setting)



                    • - Environment variable



                      On the operating system command line, type the following and press the Enter key: WRKENVVAR LEVEL(*SYS) or WRKENVVAR LEVEL(*JOB)
                      Select Option 1 on the first line, type PATH (must be uppercase) for the name, and press the Enter key.
                      For the Initial value, use something similar to the following: $PATH:/usr/bin: ($PATH indicates to insert the current PATH setting.)





                  • - No



                    Do the ls and env commands in /usr/bin or does the /usr/bin path exist?

                      • - How to do this



                        On the operating system command line, type the following, and press the Enter key: WRKLNK '/'
                        Page down to find the directory usr. Then, select Option 5 to display the directory. If the directory is not listed, 57xxSS1 Option 30 must be installed or a restore of a valid backup needs to be done.
                        Page down to find the directory bin. Then, select Option 5 to display the directory. If the directory is not listed, 57xxSS1 Option 30 must be installed or a restore of a valid backup needs to be done.



                      • - Yes



                        The user must have at least RX authority to the usr and bin folders.



                      • - How to check this



                        On the operating system command line type the following, and press the Enter key: WRKLNK '/'
                        Page down to find the usr directory and take option 12 to display the authority.
                        If the authority is fine, press F12 to return, and select Option 5 to display the usr directory.
                        Page down and find the bin directory. Then, select Option 12 to display the authority.
                        If the directory is not listed, 57xxSS1 Option 3 & 30 must be installed, or a restore of a valid backup needs to be done.

                        • - No



                          57xxSS1 Option 30 must be (re)installed to get these folders back and the last loaded cumulative tape.
                          In addition, if Java is installed; 57xxSS1 Option 3 must be reinstalled to get the Java links installed. The installation of Option 3 requires the system to be in a restricted state.
                          Note: If there is a known good backup, this directory can possibly be restored so the above installation is not be required.







                    • - No



                      This tells us that the Qshell licpgm and the basic Qshell commands are installed.

                      Is the command that is failing a Java, QSHELL, or other command?

                        • - Java



                          The most common reason this occurs is because 57xxSS1 Option 3 is not installed correctly. In addition, the 57xxJV1 Java license program must be installed. (The products are installed if the status is *COMPATIBLE). Are these installed?

                            • - How to do this:

                              How to do this:

                              1 On the CL command line, type GO LICPGM, and press the Enter key.
                              2

                              3
                              Select Option 10, Display installed licensed programs.

                              Press F11 twice to view the product option column.
                              4 Page down and look for the 57xxJV1 product options.
                              • - Yes



                                What we need to check is if symbolic links exist in the usr/bin directory for the Java commands.
                                Type this command: WRKLNK OBJ('/usr/bin/*') DETAIL(*EXTENDED)
                                Page down and locate the object java.

                                Does it exist? (This is a basic Java command)

                                  • - Yes



                                    Page up or down to see if the command that is failing is listed

                                    Is it listed?

                                      • - Yes



                                        On the command, select Option 12 to display the symbolic link
                                        Take a look at the Content of Link, is this pointing to the correct location where the program really exists?
                                        The correct location for the java command is...
                                        V5R4 and earlier - /QIBM/ProdData/OS400/Java400/jdk/bin/sys_java
                                        V6R1 - /QIBM/ProdData/OS/Java/jdk/bin/sys_java
                                        V7R1 - /QIBM/ProdData/OS400/Java400/ext/java

                                          • - How to do this?



                                            Take F14 on this screen to Work with link content. The investigate the object link path to confirm the object exists.



                                          • - Yes



                                            QSHELL is not the problem. Further investigation is required. Please contact support at 1-800-IBM-SERV.



                                          • - No



                                            This link can be manually changed; however, re-installing 57xxSS1 Option 3 would be better to make sure all the java commands are updated.

                                            You might need to contact IBM support (1-800-IBM-SERV) at this point to determine the correct path of the link.
                                            The link can not be changed, it must be deleted and recreated.

                                              • - How to do this?



                                                To create the link, type the command ADDLINK command.
                                                Object is the Content of Link or the Java program location.
                                                New link is the Object link or where the Symbolic Link will be created.

                                                  • - Example:



                                                    Following is Option 12 from the Java command java on a V6R1 system where the command exists

                                                    Display Symbolic Link
                                                    Object link . . . . . : /usr/bin/java
                                                    Content of Link . . . : /QIBM/ProdData/OS/Java/jdk/bin/sys_java

                                                    With this information, the ADDLNK command will be filled out like this:
                                                    Object . . . . . . . . . . . . . /QIBM/ProdData/OS/Java/jdk/bin/sys_java
                                                    New link . . . . . . . . . . . . /usr/bin/java
                                                    Link type . . . . . . . . . . . *SYMBOLIC *SYMBOLIC, *HARD
                                                    The Link type stays as *SYMBOLIC



                                                  • - Explanation of Link type Symbolic/Hard:



                                                    *SYMBOLIC
                                                    The link to the object is a representation of a path name. This representation is in the form of a path contained in a file. The actual path is determined by doing a path search based on the contents of the file. A symbolic link is also called soft link. Symbolic links can cross file systems. An object need not exist. An existing object can be deleted without removing the symbolic link.
                                                    *HARD
                                                    The link to the object is an actual path to an existing object. A hard link is established by creating a directory entry. Hard links cannot cross file systems. When all hard links to an object are removed, the space occupied by the object is freed and the object can no longer be accessed. An object cannot be removed while a hard link to it exists.







                                              • - No



                                                Find a system that the command works on, and find the Content of Link. Check the failing system to determine if that program exists. Does it exist?

                                                  • - Yes



                                                    This link can be manually added; however, re-installing 57xxSS1 Option 3 would be better to make sure all the java commands are updated.

                                                      • - Creating the Link



                                                        To create the link, type the ADDLINK command.
                                                        Object is the Content of Link or the Java program location.
                                                        New link is the Object link or where the Symbolic Link will be created.

                                                          • - Example


                                                            Following is Option 12 from the Java command java on a V6R1 system where the command exists

                                                            Display Symbolic Link
                                                            Object link . . . . . : /usr/bin/java
                                                            Content of Link . . . : /QIBM/ProdData/OS/Java/jdk/bin/sys_java

                                                            With this information, the ADDLNK command will be filled out like this:
                                                            Object . . . . . . . . . . . . . /QIBM/ProdData/OS/Java/jdk/bin/sys_java
                                                            New link . . . . . . . . . . . . /usr/bin/java
                                                            Link type . . . . . . . . . . . *SYMBOLIC *SYMBOLIC, *HARD
                                                            The Link type stays as *SYMBOLIC

                                                            • - Creating the Link


                                                              *SYMBOLIC
                                                              The link to the object is a representation of a path name. This representation is in the form of a path contained in a file.
                                                              The actual path is determined by doing a path search based on the contents of the file. A symbolic link is also called soft link. Symbolic links can cross file systems. An object need not exist. An existing object can be deleted without removing the symbolic link.
                                                              *HARD
                                                              The link to the object is an actual path to an existing object. A hard link is established by creating a directory entry.
                                                              Hard links cannot cross file systems. When all hard links to an object are removed, the space occupied by the object is freed and the object can no longer be accessed. An object cannot be removed while a hard link to it exists





                                                          • - No



                                                            To resolve the issue all options of 57xxJV1 and 57xxSS1 Option 3 must be re-installed. Then, install the latest cumulative and java group ptfs.





                                                        • - No



                                                          The recommended solution is re-install all options of 57xxJV1 and 57xxSS1 Option 3 from the original installation CDs. Then, install the latest cumulative and java group ptfs.



                                                        • - No


                                                          If the Java products are not installed, they must be installed from the original installation CDs. If 57xxSS1 Option 3 is not installed, the recommended solution is to re-install 57xxSS1 Option 3 from the original installation CDs. Then, install the latest cumulative and java group ptfs.

                                                            • - Possible workaround:



                                                              The symbolic link can be created manually:
                                                              If you can find the command on another system the path will be defined to provide the path

                                                                • - How to do this:



                                                                  Type this command: WRKLNK OBJ('/usr/bin/*') DETAIL(*EXTENDED)
                                                                  Page down to find the java command and take option 12 to display the symbolic link information



                                                                To create the link, type the ADDLNK command.
                                                                Object is the Content of Link or the Java program location
                                                                New link is the Object link or where the Symbolic Link will be created
                                                                  • - Example:


                                                                    Following is Option 12 from the Java command java on a V6R1 system where the command exists

                                                                    Display Symbolic Link
                                                                    Object link . . . . . : /usr/bin/java
                                                                    Content of Link . . . : /QIBM/ProdData/OS/Java/jdk/bin/sys_java

                                                                    With this information, the ADDLNK command will be filled out like this:
                                                                    Object . . . . . . . . . . . . . /QIBM/ProdData/OS/Java/jdk/bin/sys_java
                                                                    New link . . . . . . . . . . . . /usr/bin/java
                                                                    Link type . . . . . . . . . . . *SYMBOLIC *SYMBOLIC, *HARD
                                                                    The Link type stays as *SYMBOLIC

                                                                    • - Explanation of Link type Symbolic/Hard:



                                                                      *SYMBOLIC
                                                                      The link to the object is a representation of a path name. This representation is in the form of a path contained in a file. The actual path is determined by doing a path search based on the contents of the file. A symbolic link is also called soft link. Symbolic links can cross file systems. An object need not exist. An existing object can be deleted without removing the symbolic link.
                                                                      *HARD
                                                                      The link to the object is an actual path to an existing object. A hard link is established by creating a directory entry.
                                                                      Hard links cannot cross file systems. When all hard links to an object are removed, the space occupied by the object is freed and the object can no longer be accessed. An object cannot be removed while a hard link to it exists.





                                                                  • - Solution explained:



                                                                    57xxSS1 Option 3 puts symbolic links into the QSHELL /usr/bin directory for the Java commands. If the license program is not installed correctly, these links do not exist. When installing Option 3, these symbolic links will get created.








                                                              • - QSHELL



                                                                Is the command listed in the /usr/bin directory?

                                                                Note: There are some QSHELL commands that are imbedded into (for example, export) QSHELL. Therefore, they will not be displayed in /usr/bin directory.
                                                                The only way these commands do not work is if QSHELL is not installed correctly. Therefore, they should not be your problem.

                                                                  • - How to do this


                                                                    On the operating system command line, type the following: WRKLNK OBJ('/usr/bin/*') DETAIL(*EXTENDED)




                                                                  • - Yes


                                                                    Do the following:

                                                                    1 Select Option 12 on the command to display what the Symbolic Link is pointing to. (If Option 12 is not available, read the 'How to do this'.)
                                                                    2 Press F14 to Work with link content and determine if the program really does exist.
                                                                    3 Does it exist?
                                                                      • - Yes


                                                                        Find another system that the command works on and compare the Content of Link. If they are different, other commands may also not be valid. Therefore, re-installing 57xxSS1 Option 30 should be done. Then, the latest cumulative group ptf should be applied.



                                                                      • - No


                                                                        Find another system that the command works on and compare the Content of Link. If the path is different, re-install 57xxSS1 Option 30 (to fix all the commands) then install the latest cumulative group ptf, or delete this link and create a new one.

                                                                          • - How to create the link



                                                                            To create the link, on the operating system command line type the following command, and press the Enter key.

                                                                            ADDLNK

                                                                            Object is the Content of Link or the Java program location.
                                                                            New link is the Object link or where the Symbolic Link will be created.

                                                                              • - Example:


                                                                                Following is Option 12 from the Java command java on a V6R1 system where the command exists

                                                                                Display Symbolic Link
                                                                                Object link . . . . . : /usr/bin/java
                                                                                Content of Link . . . : /QIBM/ProdData/OS/Java/jdk/bin/sys_java

                                                                                With this information, the ADDLNK command will be filled out like this:
                                                                                Object . . . . . . . . . . . . . /QIBM/ProdData/OS/Java/jdk/bin/sys_java
                                                                                New link . . . . . . . . . . . . /usr/bin/java
                                                                                Link type . . . . . . . . . . . *SYMBOLIC *SYMBOLIC, *HARD
                                                                                The Link type stays as *SYMBOLIC

                                                                                • - Explanation of Link type Symbolic/Hard:



                                                                                  *SYMBOLIC
                                                                                  The link to the object is a representation of a path name. This representation is in the form of a path contained in a file. The actual path is determined by doing a path search based on the contents of the file. A symbolic link is also called soft link. Symbolic links can cross file systems. An object need not exist. An existing object can be deleted without removing the symbolic link.
                                                                                  *HARD
                                                                                  The link to the object is an actual path to an existing object. A hard link is established by creating a directory entry. Hard links cannot cross file systems. When all hard links to an object are removed, the space occupied by the object is freed and the object can no longer be accessed. An object cannot be removed while a hard link to it exists.









                                                                          • - No


                                                                            Older than V4R5?

                                                                            • - Yes


                                                                              Releases prior to V4R5M0 did not have all the QSHELL commands available, or some commands did not exist. If the command is available on a V5 system, the user must upgrade the system to get the command.



                                                                            • - No



                                                                              The user can reinstall 57xxSS1 Option 30 and the lastest cumulative grou ptf. If the user knows the command existed previously, the user can restore the /usr/bin directory.
                                                                              The link can also be manually made.

                                                                                • - How to do this:


                                                                                  The symbolic link can be created manually. If you can find the command on another system the path will be defined to give the paths.

                                                                                    • - How to do this



                                                                                      On the operating system command line type the following command, and press the Enter key.

                                                                                      WRKLNK OBJ('/usr/bin/*') DETAIL(*EXTENDED)

                                                                                      Page down to find the Java command, and select Option 12 to display the symbolic link information.



                                                                                    To create the link, on the operating system command line type the following command and press the Enter key:

                                                                                    ADDLNK

                                                                                    Object is the Content of Link or the Java program location.
                                                                                    New link is the Object link or where the Symbolic Link will be created.
                                                                                      • - Example



                                                                                        Following is Option 12 from the Java command java on a V6R1 system where the command exists

                                                                                        Display Symbolic Link
                                                                                        Object link . . . . . : /usr/bin/java
                                                                                        Content of Link . . . : /QIBM/ProdData/OS/Java/jdk/bin/sys_java

                                                                                        With this information, the ADDLNK command will be filled out like this:
                                                                                        Object . . . . . . . . . . . . . /QIBM/ProdData/OS/Java/jdk/bin/sys_java
                                                                                        New link . . . . . . . . . . . . /usr/bin/java
                                                                                        Link type . . . . . . . . . . . *SYMBOLIC *SYMBOLIC, *HARD
                                                                                        The Link type stays as *SYMBOLIC

                                                                                        • - Explanation of Link type Symbolic/Hard



                                                                                          *SYMBOLIC
                                                                                          The link to the object is a representation of a path name. This representation is in the form of a path contained in a file. The actual path is determined by doing a path search based on the contents of the file. A symbolic link is also called soft link. Symbolic links can cross file systems. An object need not exist. An existing object can be deleted without removing the symbolic link.
                                                                                          *HARD
                                                                                          The link to the object is an actual path to an existing object. A hard link is established by creating a directory entry. Hard links cannot cross file systems. When all hard links to an object are removed, the space occupied by the object is freed and the object can no longer be accessed. An object cannot be removed while a hard link to it exists.









                                                                                  • - Other



                                                                                    Commands will not run if the path to the command is not in the PATH environment variable.

                                                                                      • - To determine what the PATH is set to



                                                                                        On the command line in QSHELL, type env, and press the Enter key.
                                                                                        Near the bottom will show the value of PATH.



                                                                                      • - To change the setting of the PATH variable



                                                                                        Use one of the following methods: a profile file (two locations), in a program, or system environment variable

                                                                                          • - Profile file explanation



                                                                                            Global profile file
                                                                                            If the file /etc/profile exists, qsh runs it in the current environment when you login.
                                                                                            It is typically maintained by an administrator to set system-wide defaults for all users.
                                                                                            This file should be secured by setting the public authority to read and execute.
                                                                                            Following is a sample /etc/profile file:
                                                                                            # Sample /etc/profile file
                                                                                            export PATH=$PATH:/usr/bin: (the $PATH means insert the current PATH setting)

                                                                                            Profile file
                                                                                            If the file .profile exists in the home directory for the user, qsh runs it in the current environment when you log in.
                                                                                            It is used to customize your login environment.
                                                                                            Note: Home directory is defined in the user profile, If the location does not exist, it defaults to the root of the Integrated File System.
                                                                                            Here is a sample .profile file.
                                                                                            # Sample .profile file
                                                                                            export ENV=$HOME/.qshrc
                                                                                            export PATH=$PATH:$HOME/bin (the $PATH means insert the current PATH setting)

                                                                                            • - Program



                                                                                              In the program, insert this command:
                                                                                              export PATH=$PATH:/usr/bin: ($PATH indicates to insert the current PATH setting.)



                                                                                            • - Environment variable



                                                                                              On the operating system command line, type the following and press the Enter key: WRKENVVAR LEVEL(*SYS)
                                                                                              Select Option 1 on the first line, type PATH (must be upper case) for the name, and press the Enter key.
                                                                                              For the Initial value make it something like this: $PATH:/usr/bin: (the $PATH means insert the current PATH setting)





                                                                                          Even if the current directory is the location of the command, this will not work (command pwd will display the current directory).
                                                                                            • - Why



                                                                                              QSHELL does not look in the current directory like DOS and looks only in the PATH variable.



                                                                                            • - How to make Qshell look in the current directory for the command



                                                                                              To do this, put a period (.) and slash (/), and QSHELL will look in the current directory.
                                                                                              For example: ./ewag (This searches the current directory for the command ewag.)



                                                                                            Create a symbolic link to the command, and put the link in a location that the PATH environment already contains.
                                                                                              • - How to do this



                                                                                                If you can find the command on another system, the path will be defined to give the paths.

                                                                                                  • - How to do this



                                                                                                    On the operating system command line, type the following, and press the Enter key: WRKLNK OBJ('/usr/bin/*') DETAIL(*EXTENDED)
                                                                                                    Page down to find the java command, and select Option 12 to display the symbolic link information.



                                                                                                  To create the link, on the operating system command line type the following, and press the Enter key: ADDLNK
                                                                                                  Object is the Content of Link or the Java program location.
                                                                                                  New link is the Object link or where the Symbolic Link will be created.
                                                                                                    • - Example



                                                                                                      Following is Option 12 from the Java command java on a V6R1 system where the command exists

                                                                                                      Display Symbolic Link
                                                                                                      Object link . . . . . : /usr/bin/java
                                                                                                      Content of Link . . . : /QIBM/ProdData/OS/Java/jdk/bin/sys_java

                                                                                                      With this information, the ADDLNK command will be filled out like this:
                                                                                                      Object . . . . . . . . . . . . . /QIBM/ProdData/OS/Java/jdk/bin/sys_java
                                                                                                      New link . . . . . . . . . . . . /usr/bin/java
                                                                                                      Link type . . . . . . . . . . . *SYMBOLIC *SYMBOLIC, *HARD
                                                                                                      The Link type stays as *SYMBOLIC



                                                                                                    The Link type stays as *SYMBOLIC
                                                                                                      • - Explanation of Link type Symbolic/Hard



                                                                                                        *SYMBOLIC
                                                                                                        The link to the object is a representation of a path name. This representation is in the form of a path contained in a file. The actual path is determined by doing a path search based on the contents of the file. A symbolic link is also called soft link. Symbolic links can cross file systems. An object need not exist. An existing object can be deleted without removing the symbolic link.
                                                                                                        *HARD
                                                                                                        The link to the object is an actual path to an existing object. A hard link is established by creating a directory entry. Hard links cannot cross file systems. When all hard links to an object are removed, the space occupied by the object is freed, and the object can no longer be accessed. An object cannot be removed while a hard link to it exists.







                                                                                                Historical Number

                                                                                                333171939

                                                                                                Document information

                                                                                                More support for: IBM i
                                                                                                Programming (Languages- compilers- tools)

                                                                                                Software version: 5.1.0, 5.2.0, 5.3.0, 5.3.5, 5.4.0, 5.4.5, 6.1, 6.1.0, 6.1.1, 7.1, 7.1.0

                                                                                                Operating system(s): IBM i

                                                                                                Reference #: N1016160

                                                                                                Modified date: 16 October 2012