Iseries AS400 File Attributes

SCDFIT
SCDFIT used Ask the Experts™
on
On the IBM AS/400 where are the attributes of a file stored?  Do they reside with the file?

Is there a command to display the attributes of a file that is stored on a tape?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Developer / Database Administrator
Commented:
Normally, the attributes of a file are associated with that file itself. You'd access that info with the DspFd command.

e.g.
DspPd MyLibrary/MyFile

If the file is only on tape, I think you'd have to restore it to the file-system first.

HTH,
DaveSlash

Author

Commented:
I am interested in one of the file attributes at the time of a file was saved to tape.  I have used the DSPOBJD command and learned that the attribute had been changed.  That is why I was wondering if the attributes remain with the file when it is saved to tape.
Dave FordSoftware Developer / Database Administrator

Commented:
I suppose that depends on what attribute you're interested in. To my knowledge, all attributes follow the file itself, except things like "Last change date/time" and "Last restore date/time"

HTH,
DaveSlash
Gary PattersonVP Technology / Senior Consultant
Commented:
In general, IBM i objects are self-contained, so the answer is "yes" - attributes are saved.

For example, a physical file contains object attributes, file attributes, attributes for each member, file data (possibly segmented into multiple members) including fixed length data space and overflow space (for variable length data over the allocated length and LOBs).  All of that is saved to tape as part of the member.

One thing that isn't stored as part of the object are private authorities. Private authorities are saved as part of the user profile.

Some of these attributes, of course, are updated during save/restore operations: like last restore date, as daveslash mentions above.

DSPTAP DATA(*SAVRST) will show some very basic information about each saved object, including size, but in order to view most of the attributes of an object stored on tape, you'll need to restore the object.  You can always restore the saved object to a different library, where you can examine all of the attributes using DSPOBJD/DSPFD commands.

It is possible to use the DMPTAP command to dump raw save/restore data, but this is very difficult to decode unless you have a knowledge of the internal structure of the object.
You can use DSPFD to check file level attributes and DSPFFD to check field level

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial