Search in a Physical file

Tags:
PF
Physical File
How can search for a particular string in physical file when there is not any primary key in physical file. There is not any information about the field name and field structures also.. e.g. like we have to search for "anshu" in a PF but we dont have ay idea about the feilds in the PF. PF doesnot contain any primary key either. Kindly reply as soon as possible..
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Question: What tools can you use?
Query/400, SQL, RPGLE???

Field information is available with the DSPFFD command

If this is a “Flat file” — probably downloaded, one field for the file it can still be searched using any of the above methods.

Hi

U can search any particular string
with
DSPPFM command
put the text on find
then shift F4

Thanks
Reshma

Discuss This Question: 7  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.
  • Colin Smith
    You could also do this with a script. VBScript or Powershell can accomplish this very easily. Is it only one file that you need to scan for this keyword or are you interested in multiple files? What OS are you on? Is this something that needs to be done often? If so then a script may be the way to go for you on this.
    945 pointsBadges:
    report
  • rajeshece
    Hi Smith, Can you give me the code and also help me to execute the code
    1,230 pointsBadges:
    report
  • 65GTO
    Another way would to use Display Physical File Member command. On the command line, key: DSPPFM XXXXX, where XXXXX is the Physical File name. At top of page look for Find........... ___________________________ Key in what you are serching for Press F16 What you are searching for will be shown in reverse image.
    345 pointsBadges:
    report
  • Colin Smith
    Sure. I like working in Powershell and I find this to be a more simple task so here is the code that I would use. I am not sure still if you are only looking at one file and what you want to do if you find what you are looking for but here is a very basic script to get done what you need. $file = get-content 'path to file' foreach($line in $file) { if($line -like "*keyword*") { Echo "Found entry in file" } } This is Powershell so you need to have Powershell installed on the machine that is executing the script. If you have any questions let me know. You can email me at colin@sysadminsmith.com
    0 pointsBadges:
    report
  • mcl
    Powershell? Isn't that some Windoze thing? I thought this was an AS/400 forum. So, who was asking what OS? That should be OS/400 or i5OS (or whatever IBM calls it now) The original poster mentioned "PF" which tends to point to an AS/400 "Physical File". 65GTO gave probably the simplest answer - and quite correct IMO for a simple search of a file. Regards Mike
    2,740 pointsBadges:
    report
  • philpl1jb
    Mike Cool your jets man. The "I" thingy is a great box and has all the answers on board but there are front end developers who use it as a data server and aren't ever going to sign onto a greeen screen. Apparently what PiyushSingh needed he/she got. Phil
    54,090 pointsBadges:
    report
  • Bo
    Use FNDSTRPDM + F4 from command line
    35 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.

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

Following

Share this item with your network: