How to get the list of files in a library to a outfile

5 pts.
Tags:
DSPOBJD
MS
How to get the list of *file of attribute PF in a library in an outfile

Answer Wiki

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

use DSPOBJD command for <i>list of *file of attribute PF in a library in an outfile</i>….

Object . . . . . . . . . . . . . > *ALL
Library . . . . . . . . . . . > Libname
Object type . . . . . . . . . . > *ALL
+ for more values
Detail . . . . . . . . . . . . . *BASIC
Output . . . . . . . . . . . . . > *OUTFILE
File to receive output . . . . . outfilename
Library . . . . . . . . . . . libname
Output member options:
Member to receive output . . . *FIRST
Replace or add records . . . . *add

after, <b>runqry *n outfilename</b>

it ll show all <b>object , object type, object attribute, object size, text description</b>
in your library……

sathish

Discuss This Question: 22  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
  • pdsathishkumar
    Except my answer, Is there any related answer for this question?
    3,790 pointsBadges:
    report
  • TomLiotta
    Is there any related answer for this question? Sure, though other methods can require creating programming to do the writes to the desired database table. You could use the List Objects (QUSLOBJ) or Open List of Objects (QGYOLOBJ) API, and proces the list. Write each item to the table. You could also simply SELECT from the view that already lists files (tables) in libraries (schemas):
    SELECT SYS_TNAME, SYS_DNAME FROM SYSTABLES WHERE SYS_DNAME = 'mylibrary'
    Since SYSTABLES already exists, there really isn't much need to "get the list of *file of attribute PF in a library in an outfile". (This may only include externally-described files.) For a simple, direct answer, DSPOBJD works fine. DSPFD is a little more direct since it focuses on *FILE attributes rather than common object attributes. Tom
    125,585 pointsBadges:
    report
  • pdsathishkumar
    Mr. Tom, i tried this concept using DSPFD command, but it not working.. show error that is.... : OUTFILE not allowed with specified TYPE. Display File Description (DSPFD) File . . . . . . . . . . . . . . FILE > *ALL Library . . . . . . . . . . . > libname1 Type of information . . . . . . TYPE > *ALL + for more values Output . . . . . . . . . . . . . OUTPUT > *OUTFILE File attributes . . . . . . . . FILEATR > *ALL + for more values File to receive output . . . . . OUTFILE > outfile1 Library . . . . . . . . . . . > libname1 Output member options: OUTMBR Member to receive output . . . *FIRST Replace or add records . . . . > *ADD can i do any correction.... please share me....
    3,790 pointsBadges:
    report
  • TomLiotta
    OUTFILE not allowed with specified TYPE. You specified TYPE(*ALL). The error tells you that you can't use the *OUTFILE option with that type. The help text for the error tells you what you need to do. The help text for the OUTFILE() parameter tells you why. Tom
    125,585 pointsBadges:
    report
  • pdsathishkumar
    How to get the list of files in a library to a outfile using DSPFD... but i don't how to do this...
    3,790 pointsBadges:
    report
  • TomLiotta
    but i don’t how to do this… Don't use TYPE(*ALL). Read the help text for the command. If a part of the help text doesn't make sense, ask about it. If the help text isn't telling you what needs to be entered for a parameter, I don't know what else can be said. If you try values for parameters that don't work, show what you tried and what messages resulted. Tom
    125,585 pointsBadges:
    report
  • ToddN2000
    Try this command. DSPFD FILE(MYLIB/*ALL) TYPE(*BASATR) OUTPUT(*OUTFILE) FILEATR(*PF) OUTFIL E(QTEMP/MYFILES). Some of the default values on the command will keep it from running. You have to play with them. If you leave the defaut value for "Type of information" as *ALL it won't work. The command above will.
    11,820 pointsBadges:
    report
  • pdsathishkumar
    using this DSPFD FILE(MYLIB/*ALL) TYPE(*BASATR) OUTPUT(*OUTFILE) FILEATR(*PF) OUTFIL E(QTEMP/MYFILES). it ll show lot of information, but this command doesn't retrieve object size...
    3,790 pointsBadges:
    report
  • ToddN2000
    If you want the size change the type from *BASATR to *MBRLIST. use this command DSPFD FILE(MYLIB/*ALL) TYPE(*MBRLIST) OUTPUT(*OUTFILE) FILEATR(*PF) OUTFILE(QTEMP/MYFILES)
    11,820 pointsBadges:
    report
  • pdsathishkumar
    the type(*basatr) and (*mbrlist) doesn't retrieve object size. i tried it....
    3,790 pointsBadges:
    report
  • CharlieBrowne
    Try this: DSPOBJD OBJ(&LIB/*ALL) OBJTYPE(*ALL) + OUTPUT(*OUTFILE) OUTFILE(QTEMP/LIBOBJS)
    41,380 pointsBadges:
    report
  • TomLiotta
    the type(*basatr) and (*mbrlist) doesn’t retrieve object size. That's right. But you didn't ask about object size. You asked about a list of files. However, *MBRLIST does give the size of each member. The sum of the data space sizes all members of a file can approximate the total *FILE object size. They won't exactly match because the *FILE object itself has its own size outside of any members that might be part of it. For example, part of the *FILE object is an index that points to each member. The size of the index is not part of any member. Tom
    125,585 pointsBadges:
    report
  • Alexlex
    Fantastic... Thank you very very much.. Now i can get the top deleted records report. Btw, anyone performance iSeries DB2 Performance Tuning? Just want know which part in the system need to analysis & tune? or which part need to focus on...
    50 pointsBadges:
    report
  • TomLiotta
    Now i can get the top deleted records report. There are still sites doing this? Btw, anyone performance iSeries DB2 Performance Tuning? This is way off the thread here. You'll almost certainly have better discussions under a thread that you open for the topic. Tom
    125,585 pointsBadges:
    report
  • Archnav01
    Can anyone tell me what are the specifications the outfile should have? I'm getting 'format of output file not valid' error 
    270 pointsBadges:
    report
  • TomLiotta
    Specifications aren't used. Make sure you give an output file name that doesn't exist in your library. The command will create the output file for you. -- Tom
    125,585 pointsBadges:
    report
  • Archnav01
    Thanks a lot. It works..
    270 pointsBadges:
    report
  • Archnav01
    In dspobjd command, we're giving the obj type as the criteria. Is it possible to filter a list that doesnt comprise the source physical file? That is.., To display objects other than those ehich has obj attribute as 'pf-src'?
    270 pointsBadges:
    report
  • Archnav01
    I've obtained a output file (file1) if some filter conditions have to be given (say a where condition) where to specify that?
    270 pointsBadges:
    report
  • WoodEngineer
    Step 1) Issue command ToddN2000 recommends.  Outfile will include the record counts you want. Step 2) Use SQL or a query progam to filter the objects you want to list.
    6,680 pointsBadges:
    report
  • Archnav01
    My qryslt is not working: qryslt('fldname *ne "q%"') To omit the values staring with 'q'.. Pls help 
    270 pointsBadges:
    report
  • WoodEngineer
    Try "not like" instead of "*NE" on your query select statement. Check out the documentation on LIKE.  It has a lot of options for fine tuning your selection.
    6,680 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