ディレクトリの情報を返します。
| カテゴリ: | 外部ファイル |
| Windows固有: | 使用可能な情報項目は、ディレクトリパス名のみです。 |
| UNIX固有: | 使用可能な情報項目は、ディレクトリパス名、所有者、グループ、権限、最終変更時間です。 |
| z/OS固有: | 使用可能な情報項目は、システム構成によって異なります。 |
|
項目
|
項目識別子
|
定義
|
|---|---|---|
|
1
|
Filename
|
ディレクトリ名
|
|
2
|
Access Permission
|
所有者、グループおよびその他の読み取り権限、書き込み権限および実行権限
|
|
3
|
リンクの数
|
ディレクトリのリンクの数
|
|
4
|
Owner Name
|
所有者のユーザーID
|
|
5
|
Group Name
|
所有者のアクセスグループの名前
|
|
6
|
Filesize
|
ファイルのサイズ
|
|
7
|
Last Modified
|
コンテンツが最後に変更された日付
|
%let filrf=MYDIR; %let rc=%sysfunc(filename(filrf, "physical-name")); %let did=%sysfunc(dopen(&filrf)); %let numopts=%sysfunc(doptnum(&did)); %let foption=%sysfunc(doptname(&did, &numopts)); %let charval=%sysfunc(dinfo(&did, &foption)); %let rc=%sysfunc(dclose(&did));
data diropts;
length optname $ 32 optval $ 40;
rc=filename("mydir", "physical-name");
put "rc = 0 if the directory exists: " rc=;
did=dopen("mydir");
numopts=doptnum(did);
do i=1 to numopts;
optname=doptname(did, i);
put i= optname=;
optval=dinfo(did, foption);
put optval=;
end;
run;

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