Category: | External Files |
z/OS specifics: | info-item |
See: | FINFO Function in SAS Functions and CALL Routines: Reference |
data _null_; length opt $100 optval $100; /* Allocate file */ rc=FILENAME('myfile', 'userid.test.example'); /* Open file */ fid=FOPEN('myfile'); /* Get number of information items */ infocnt=FOPTNUM(fid); /* Retrieve information items and print to log */ put @1 'Information for a Sequential File:'; do j=1 to infocnt; opt=FOPTNAME(fid,j); optval=FINFO(fid,upcase(opt)); put @1 opt @20 optval; end; /* Close the file */ rc=FCLOSE(fid); /* Deallocate the file */ rc=FILENAME('myfile'); run;
data _null_; length opt $100 optval $100; /* Allocate file */ rc=FILENAME('myfile', 'userid.test.data(oats)'); /* Open file */ fid=FOPEN('myfile'); /* Get number of information items */ infocnt=FOPTNUM(fid); /* Retrieve information items and print to log */ put @1 'Information for a PDS Member:'; do j=1 to infocnt; opt=FOPTNAME(fid,j); optval=FINFO(fid,upcase(opt)); put @1 opt @20 optval; end; /* Close the file */ rc=FCLOSE(fid); /* Deallocate the file */ rc=FILENAME('myfile'); run;
data _null_; length opt $100 optval $100; /* Allocate file */ rc=FILENAME('myfile', '/u/userid/one'); /* Open file */ fid=FOPEN('myfile'); /* Get number of information items */ infocnt=FOPTNUM(fid); /* Retrieve information items and print to log */ put @1 'Information for a UNIX System Services File:'; do j=1 to infocnt; opt=FOPTNAME(fid,j); optval=FINFO(fid,upcase(opt)); put @1 opt @20 optval; end; /* Close the file */ rc=FCLOSE(fid); /* Deallocate the file */ rc=FILENAME('myfile'); run;
Information for a UNIX System Services File: File Name /u/userid/one Access Permission -rw-rw-rw- Number of Links 1 Owner Name USERID Group Name GRP File Size 4 Last Modified Apr 13 13:57 Created Mar 16 09:55 NOTE: The DATA statement used 0.07 CPU seconds and 5227K.