Want to make a utility to search string.

100 pts.
Tags:
CL
CLLE
RPG
RPGLE
[h3 class="groups"> Hi,[/h3] [h3 class="groups">I want to make a utility in AS400 to search a string (Such as file name/PGM name) in my current Library and in all Source physical files if found show PGM and all related files. Like I do trough find string Command. [/h3] It would be also help ful you can tell me how to see dependant logical file on a Physical Files I want the name of logical files and Qualified location.

Thanks



Software/Hardware used:
as400

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 10  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • philpl1jb
    It would be also help ful you can tell me how to see dependant logical file on a Physical Files I want the name of logical files and Qualified location. Check out command DSPDBR.
    50,860 pointsBadges:
    report
  • philpl1jb
    Search member and Source Member on this board .. we've had a number of questions in this area. Can we eliminate RPG .. just discuss CL and RPGLE???
    50,860 pointsBadges:
    report
  • philpl1jb
    Also look at the command DSPPGMREF
    50,860 pointsBadges:
    report
  • TomLiotta
    What kinds of objects will you be searching? The only useful objects you can usually search will be files, but it seems like you might want to search programs, too. But you can't search through compiled programs for strings. Please give examples of some searches. Tom .
    125,585 pointsBadges:
    report
  • Builtin
    Thanks Philip for you solution that I also Know but I want to retrieve the names of dependent file in my program itself and and want to search in all my source physical file in a library(*CURLIB).
    100 pointsBadges:
    report
  • Builtin
    Thanks tom for your response I can make Picture more Clear. I want these steps in my PGM which i Manually do to search anything (PGM/File) 1. WRKOBJPDM object type *file, Object Attribute pf-src. This is how I will get the list of all source file in my Current Library. 2. now write 25 in option infront of any PGM/File Name. This is for search string. 3. Press F13. This will select all, than press enter. Write the string Name you want to Search in option leave it for display. press Enter again you will be able to search all type of objects with the same name. I want to do this whole Procedure in My Program but I am unable to use any Logic for selection.
    100 pointsBadges:
    report
  • Splat
    FNDSTRPDM will search through file members for specified strings. To identify dependent logicals you will need to use either the DSPDBR command or the QDBLDBR API.
    7,565 pointsBadges:
    report
  • TomLiotta
    I want to do this whole Procedure in My Program but I am unable to use any Logic for selection. To search a single source member in a source file in a library, override to the member, open the file, and read each record. For each record, test to see if the string is found anywhere in the SRCDAT field. To test to see if a substring is found in a character field, you could call the Scan for String Pattern (QCLSCAN) API. (See Examples: Scanning string patterns for some discussion of patterns and results.) Or if you're more comfortable with C, you could use the strstr() — Locate Substring C runtime library function. Either one can be used in any ILE language. If you need to search through all members of a source file, you'll want to create a list of members. For each member in the list, call the function you create for the process above. You can create a list in a file by running the DSPFD command with either TYPE(*MBRLIST) or TYPE(*MBR) and with OUTPUT(*OUTFILE). You can also call the List Database File Members (QUSLMBR) API if you prefer having the list in a user space (which has advantages over building a list in a file). If you want to search members in multiple source files, then you'll need to create a list of those files. For each file, you would call the function you created above to process each member. And if you need to process files from multiple libraries, you'll need to create a list of those libraries. For each library, you will call your function to list the files in the library in order to call the function to list the members in each file, in order to search each member. Each higher function calls down to the next lower function. In any case, it's not clear yet what you actually want to do. You described an interactive process that uses PDM. Why isn't that good enough? What will your program do that you can't do with PDM? A simple search doesn't actually do anything. What do you want to happen when a match is found? The FNDSTRPDM command will do a lot of the whole process. But even for that, you have to tell it what to do when it finds a match. Tom
    125,585 pointsBadges:
    report
  • Builtin
    Thanks tom Now its Crystal Clear
    100 pointsBadges:
    report
  • Builtin
    actually I got the requirement from some Client so have to do this
    100 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following