5 pts.
 How to get the list of files in a library to a outfile
How to get the list of *file of attribute PF in a library in an outfile

Software/Hardware used:
ASKED: December 21, 2011  10:03 AM
UPDATED: March 17, 2012  6:10 AM

Answer Wiki:
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
Last Wiki Answer Submitted:  December 21, 2011  10:49 am  by  pdsathishkumar   3,740 pts.
All Answer Wiki Contributors:  pdsathishkumar   3,740 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Except my answer, Is there any related answer for this question?

 3,740 pts.

 

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

 110,135 pts.

 

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,740 pts.

 

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

 110,135 pts.

 

How to get the list of files in a library to a outfile using DSPFD…

but i don’t how to do this…

 3,740 pts.

 

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

 110,135 pts.

 

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.

 4,115 pts.

 

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,740 pts.

 

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)

 4,115 pts.

 

the type(*basatr) and (*mbrlist) doesn’t retrieve object size. i tried it….

 3,740 pts.

 

Try this:
DSPOBJD OBJ(&LIB/*ALL) OBJTYPE(*ALL) +
OUTPUT(*OUTFILE) OUTFILE(QTEMP/LIBOBJS)

 33,695 pts.

 

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

 110,135 pts.

 

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 pts.

 

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

 110,135 pts.

 

Can anyone tell me what are the specifications the outfile should have? I’m getting ‘format of output file not valid’ error 

 270 pts.

 

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

 110,135 pts.

 

Thanks a lot. It works..

 270 pts.

 

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 pts.

 

I’ve obtained a output file (file1) if some filter conditions have to be given (say a where condition) where to specify that?

 270 pts.

 

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.

 5,555 pts.

 

My qryslt is not working:
qryslt(‘fldname *ne “q%”‘)
To omit the values staring with ‘q’..
Pls help 

 270 pts.

 

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.

 5,555 pts.