I want to dump the contents of the DSPFD command to file and then use FNDSTRPDM to find certain text strings

45 pts.
Tags:
AS/400 commands
Database Files
DSPFD
FNDSTRPDM
I am doing some testing with file attributes that I want to automate.  I have been using the DSPFD command to print the attributes of the file.  I would now like to automate that.  I tried dumping the output of the command to an outfile and then using FNDSTRPDM to find out if the attribute was set correctly.  The outfile is a database file so the fndstrpdm doesn't really work for me as my output is in hex.

Does anyone have any ideas on how I might accomplish this?

Answer Wiki

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

try writing a query instead of FNDSTRPDM

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
  • Qa400
    I am afraid that is beyond my current Iseries skills. I have no idea what the database looks like, etc. But thanks for the suggestion!!!
    45 pointsBadges:
    report
  • TomLiotta
    I have no idea what the database looks like... You shouldn't need to know. The query interface will tell you. Can you explain a little more what file attributes you're looking at? Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    Since you have a database, you could use the command DSPPFM (Display physical file member) it has a search like find string. But the query/400 tool is very easy to use .. WrkQRY command will start it. Plenty of info on it available on the Web or come back here with your questions. Phil
    49,550 pointsBadges:
    report
  • Qa400
    Tom - I am looking at many different attributes - I am testing a software product and I want to be able to easily verify in an automated way that certain attribs are being set correctly via the software when it creates a file. (alwdlt, alwupt, delpct,expdate,etc) There will be many tests so I was trying to keep as simple as possible. I will take a look at the query interface - Thanks for your help
    45 pointsBadges:
    report
  • Qa400
    Thanks Phil - I am going to look into the query tool.
    45 pointsBadges:
    report
  • AnchorS
    If youi're looking for the attributes of the file, you're using the right command, dspfd, just dump it to an *outfile. You'll need to provide the file name and library. Then query the resulting database file.
    380 pointsBadges:
    report
  • TomLiotta
    I am testing a software product and I want to be able to easily verify in an automated way that certain attribs are being set correctly... In that case, you probably want a basic CL program that does most/all of the work. Try these two commands to get some background on what happens:
    DSPFD FILE(QAFDPHY)
          TYPE(*ATR)
          OUTPUT(*OUTFILE)
          FILEATR(*PF)
          OUTFILE(QTEMP/ATR)
    RUNQRY QRYFILE((QTEMP/ATR))
    The DSPFD command converts the attributes of one of the system files on your system into an outfile. The RUNQRY command does a basic query of the content of the outfile. The outfile is created in QTEMP, so it will disappear when you sign off of your session. That system file is one of the "model" files that are supplied with your system. In fact, it's the model that is used by the DSPFD command when you request TYPE(*ATR) for FILEATR(*PF) files. So the DSPFD command is retrieving the attributes of the file that defines what the output of the DSPFD output will contain -- kind of a circular reference there. (It seemed like a good example to use.) By looking at what RUNQRY shows, you can see if the attributes that you're looking for are supplied. If they are, then the rest is fairly straightforward. If they aren't, then we need to know what else you need to see. Post back if this is a direction we can go or not. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    BTW, what is your programming background? A Windows or Unix background might indicate other directions are better. Tom
    125,585 pointsBadges:
    report
  • Qa400
    Thanks Tom. I am going to try the CL programming. I have done some things in CL but by no means an expert. My background is MVS - Z/os. I do not have a development background so things get tricky for me sometimes.
    45 pointsBadges:
    report
  • Qa400
    [...] I want to dump the contents of the DSPFD command to file and then use FNDSTRPDM to find certain text... [...]
    0 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