DSNINFO(dsname[,volser][,option])
Note: If the data set is not cataloged, you must specify the volser argument.
Notes:
All other items will contain question marks.
When the return code is zero, the fields below are returned (the fields are separated by one blank).
Word | Data Item | Option | Group | Description |
---|---|---|---|---|
1. | rc | B | N.A. | Return code. |
2. | dsname | B | Catalog | The data set name (fully qualified, no quotes). |
3. | volser | B | Catalog | Volume serial number. If the data set spans volumes, only the first volser is reported. |
4. | unit | B | Catalog | Type of unit (e.g., "3390"). If the data set spans volumes, only the first unit is reported. |
5. | dsorg | B | VTOC | Data set organization. PDSE data sets are indicated with the "PO-E" designation. |
6. | recfm | B | VTOC | The record format. |
7. | lrecl | B | VTOC | The logical record length. |
8. | blksize | B | VTOC | The block size. |
9. | keylen | B | VTOC | Hardware key length (not usually present). |
10. | rkp | B | VTOC | Relative key position (not usually present). |
11. | created | B | VTOC | Date of creation. |
12. | expires | B | VTOC | Date the data set expires (is deleted). |
13. | referenced | B | VTOC | Date most recently opened. |
14. | password | B | VTOC |
|
15. | updated | B | VTOC |
|
16. | racfprof | B | VTOC |
|
17. | managed | B | VTOC |
|
18. | ddname | B | Alloc. | The data definition name. |
19. | status | B | Alloc. | The allocation status. |
20. | ndisp | B | Alloc. | The normal disposition. |
21. | cdisp | B | Alloc. | The conditional disposition. |
22. | units | F | Space | The units by which the data set is allocated (CYLINDERS, TRACKS, BLOCKS). |
23. | alloc | F | Space | Number of units presently allocated. |
24. | used | F | Space | Number of units presently used. |
25. | extents | F | Space | Number of extents presently allocated. |
26. | primary | F | Space | Number of units specified for primary allocation. |
27. | secondary | F | Space | Number of units specified for secondary allocations. |
28. | blkstrk | F | Space | Number of blksize blocks that will fit on a track on this volume. |
29. | trkscyl | F | Space | Number of tracks per cylinder for this volume |
30. | cylsvol | F | Space | Number of cylinders for this volume |
31. | adirblks | F | Dirctry | Number of directory blocks allocated. Not available for PDSEs. |
32. | udirblks | F | Dirctry | Number of directory blocks in use. |
33. | members | F | Dirctry | Number of members. |
34. | dsntype | F | SMS | The SMS data set type. |
35. | storclass | F | SMS | SMS storage class. |
36. | mgmtclass | F | SMS | SMS management class. |
37. | dataclass | F | SMS | SMS data class. |
If a data item is unavailable, the interface supplies a single question mark (?) as a placeholder. This ensures that the word position of all data items remains constant.
If the return code is not zero, the following data items are returned.
Word | Data Item | Description |
---|---|---|
1. | rc | Return code. |
2. | dsname | The data set name (fully qualified, no quotes). |
3. | reason | The reason code in printable hex, or 8 zeros if not applicable. |
message | A textual error message describing the service detecting the error, and the nature of the error. The message can (and usually does) contain embedded blanks. |
If you CALL the DSNINFO function, the returned value is contained in the RESULT special variable. The RC variable is unchanged (unless you assign the return code to it). A return code of zero always indicates success.
parse value dsninfo("user.data",,'f') with rc info if rc = 0 then parse var info dsname volser unit dsorg recfm lrecl, blksize keylen rkp created expires referenced, password updated racfprof managed ddname, status ndisp cdisp units alloc used extents, primary secondary blkstrk trkscyl cylsvol, adirblks udirblks members dsntype sclass mclass, dclass else parse var info dsname reason message
parse value dsninfo("'sys1.lib1'",'mvs001') with rc info if rc = 0 then parse var info dsname volser unit dsorg recfm lrecl, blksize keylen rkp created expires referenced, password updated racfprof managed ddname, status ndisp cdisp else parse var info dsname reason message