02.05.2013 Views

SAS(R) 9.1.3 Companion for z/OS

SAS(R) 9.1.3 Companion for z/OS

SAS(R) 9.1.3 Companion for z/OS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

264 FINFO Function Chapter 13<br />

and print to log */<br />

put @1 ’In<strong>for</strong>mation <strong>for</strong> a PDS<br />

Member:’;<br />

do j=1 to infocnt;<br />

opt=FOPTNAME(fid,j);<br />

optval=FINFO(fid,upcase(opt));<br />

put @1 opt @20 optval;<br />

end;<br />

/* Close the file */<br />

rc=FCL<strong>OS</strong>E(fid);<br />

/* Deallocate the file */<br />

rc=FILENAME(’myfile’);<br />

run;<br />

Output 13.5 PDS, PDSE Member In<strong>for</strong>mation<br />

In<strong>for</strong>mation <strong>for</strong> a PDS Member:<br />

Dsname USERID.TEST.DATA(OATS)<br />

Unit 3380<br />

Volume ABC006<br />

Disp SHR<br />

Blksize 1000<br />

Lrecl 100<br />

Recfm FB<br />

NOTE: The DATA statement used 0.05<br />

CPU seconds and 5194K.<br />

Example 3: UNIX System Services File In<strong>for</strong>mation<br />

This example shows the in<strong>for</strong>mation items available <strong>for</strong> UNIX System Services files:<br />

data _null_;<br />

length opt $100 optval $100;<br />

/* Allocate file */<br />

rc=FILENAME(’myfile’,<br />

’/u/userid/one’);<br />

/* Open file */<br />

fid=FOPEN(’myfile’);<br />

/* Get number of in<strong>for</strong>mation<br />

items */<br />

infocnt=FOPTNUM(fid);<br />

/* Retrieve in<strong>for</strong>mation items<br />

and print to log */<br />

put @1 ’In<strong>for</strong>mation <strong>for</strong> a UNIX<br />

System Services File:’;<br />

do j=1 to infocnt;<br />

opt=FOPTNAME(fid,j);<br />

optval=FINFO(fid,upcase(opt));<br />

put @1 opt @20 optval;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!