I want to find that a given source member exists in any source physical file (SRC-PF
) of a provided library. In my library, there are lots of source physical files and I do not want to go to each source physical file of the provided library using WRKMBRPDM
on the IBM i green screen and search for the given source member. Is there any way or command that I can run once and get to know immediately whether the source member exists in any of the src-pf of a given library?
We can do this by running the
QSHELL
commandls
on the IBM i green screen by invoking theQshell
environment using theSTRQSH
command.ls /qsys.lib/libname.lib/Q*SRC.FILE/srcmbrname.MBR
ls
command will list out files and directories.For example: I want to search for source member name
file1
in all of the source files available in the libraryTESTLIB
, if it finds the source member the command will list out that member and if it does not find that source member then it gives error.Ran the following QSH command after running STRQSH on the command line,
ls /qsys.lib/testlib.lib/Q*SRC.FILE/file1.MBR
Source member found and its output is:
/qsys.lib/testlib.lib/QDDSSRC.FILE/file1.MBR
The source member
FILE1
is present in theQDDSSRC
source file in the libraryTESTLIB
.Now, run the following QSH command after running STRQSH on the command line,
ls /qsys.lib/testlib.lib/Q*SRC.FILE/filea.MBR
Source member not found and its output is:
ls: 001-2113 Error found getting information for object /qsys.lib/testlib.lib/Q*SRC.FILE/filea.MBR. No such path or directory.