Functions and CALL Routines under z/OS |
Category: | External Files |
z/OS specifics: | info-item |
See: | DINFO Function in SAS Language Reference: Dictionary |
Syntax | |
Details | |
Example 1: UNIX File System (UFS) Directory Information | |
Example 2: PDSE Directory Information | |
Example 3: PDS Directory Information | |
See Also |
Syntax |
DINFO(directory-id, info-item) |
specifies the identifier that was assigned when the directory was opened, generally by the DOPEN function.
specifies the information item to be retrieved. DINFO returns a blank if the value of the info-item argument is invalid. The information available varies according to the operating environment. The info-item argument is a character value.
Details |
Directories that are opened with the DOPEN function are identified by a directory-id and have a number of associated information items. Use DOPTNAME to determine the names of the available system-dependent directory information items. Use DOPTNUM to determine the number of directory information items available.
The DINFO, DOPTNAME, and DOPTNUM functions support the following directory information items under z/OS.
Item | Item Identifier | Definition |
---|---|---|
1 | Filename | Directory name |
2 | Access Permission | Read, write, and execute permissions for owner, group, and other |
3 | Number of Links | Number of links in the directory |
4 | Owner Name | User ID of the owner |
5 | Group Name | Name of the owner's access group |
6 | Filesize | File size |
7 | Last Modified | Date contents last modified |
Item | Item Identifier | Definition |
---|---|---|
1 | Dsname | PDS name |
2 | Unit | Disk type |
3 | Volume | Volume on which data set resides |
4 | Disp | Disposition |
5 | Blksize | Block size |
6 | Lrecl | Record length |
7 | Recfm | Record format |
Item | Item Identifier | Definition |
---|---|---|
1 | Dsname | PDSE name |
2 | Dsntype | Directory type |
3 | Unit | Disk type |
4 | Volume | Volume on which data set resides |
5 | Disp | Disposition |
6 | Blksize | Block size |
7 | Lrecl | Record length |
8 | Recfm | Record format |
Example 1: UNIX File System (UFS) Directory Information |
This example generates output that includes information item names and values for a UFS directory:
data _null_; length opt $100 optval $100; /* Allocate directory */ rc=FILENAME('mydir', '/u/userid'); /* Open directory */ dirid=DOPEN('mydir'); /* Get number of information items */ infocnt=DOPTNUM(dirid); /* Retrieve information items and */ /* print to log */ put @1 'Information for a UNIX File System Directory:'; do j=1 to infocnt; opt=DOPTNAME(dirid,j); optval=DINFO(dirid,upcase(opt)); put @1 opt @20 optval; end; /* Close the directory */ rc=DCLOSE(dirid); /* Deallocate the directory */ rc=FILENAME('mydir'); run;
Information for a UNIX System Services Directory: Directory Name /u/userid Access Permission drwxr-xr-x Number of Links 17 Owner Name MYUSER Group Name GRP Last Modified Apr 26 07:18 Created Jan 9 2007 NOTE: The DATA statement used 0.09 CPU seconds and 5203K.
Example 2: PDSE Directory Information |
This example generates directory information for a PDSE:
data _null_; length opt $100 optval $100; /* Allocate directory */ rc=FILENAME('mydir', 'userid.pdse.src'); /* Open directory */ dirid=DOPEN('mydir'); /* Get number of information items */ infocnt=DOPTNUM(dirid); /* Retrieve information items and */ /* print to log */ put @1 'Information for a PDSE:'; do j=1 to infocnt; opt=DOPTNAME(dirid,j); optval=DINFO(dirid,upcase(opt)); put @1 opt @20 optval; end; /* Close the directory */ rc=DCLOSE(dirid); /* Deallocate the directory */ rc=FILENAME('mydir'); run;
Information for a PDSE: Dsname USERID.PDSE.SRC Dsntype PDSE Unit 3380 Volume ABC002 Disp SHR Blksize 260 Lrecl 254 Recfm VB Creation 2005/10/03 NOTE: The DATA statement used 0.08 CPU seconds and 5203K.
Example 3: PDS Directory Information |
This example generates information item names and values for a PDS:
data _null_; length opt $100 optval $100; /* Allocate directory */ rc=FILENAME('mydir', 'userid.mail.text'); /* Open directory */ dirid=DOPEN('mydir'); /* Get number of information items */ infocnt=DOPTNUM(dirid); /* Retrieve information items and */ /* print to log */ put @1 'Information for a PDS:'; do j=1 to infocnt; opt=DOPTNAME(dirid,j); optval=DINFO(dirid,upcase(opt)); put @1 opt @20 optval; end; /* Close the directory */ rc=DCLOSE(dirid); /* Deallocate the directory */ rc=FILENAME('mydir'); run;
Information for a PDS: Dsname USERID.MAIL.TEXT Unit 3380 Volume ABC005 Disp SHR Blksize 6160 Lrecl 80 Recfm FB Creation 2005/10/03 NOTE: The DATA statement used 0.07 CPU seconds and 5211K.
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.