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.

56 Assigning <strong>SAS</strong> Data Libraries Internally Chapter 2<br />

3 DDnames that are allocated externally are not included in the list that is produced<br />

by the LIBNAME LIST statement nor in the <strong>SAS</strong> Explorer window until after they<br />

have been used as librefs in your <strong>SAS</strong> session. (See “Listing Your Current Librefs”<br />

on page 61.)<br />

Accessing <strong>SAS</strong> Data Sets without a Libref Using Quoted References<br />

As an alternative to the libref.member syntax, it is possible to refer to some <strong>SAS</strong> files<br />

directly by merely specifying the library and member name. This is supported even in<br />

cases in which the library has not yet been assigned (such as via external allocation or<br />

a LIBNAME statement). <strong>SAS</strong> automatically assigns the library, if necessary, when the<br />

first reference to the library is made. The engine is determined by default according to<br />

the rules described in “How <strong>SAS</strong> Assigns an Engine” on page 59.<br />

Note: This method of identifying <strong>SAS</strong> files should only be used <strong>for</strong> <strong>SAS</strong> files that are<br />

residing in libraries that can be allocated internally via a LIBNAME statement or<br />

function and <strong>for</strong> which no LIBNAME options need to be specified. <strong>SAS</strong> determines<br />

which engine to use by following the rules described in “How <strong>SAS</strong> Assigns an Engine”<br />

on page 59. However, <strong>for</strong> <strong>SAS</strong> files in HFS libraries, it is possible also to specify the file<br />

extension and thus control which engine should be used. This technique is described<br />

below. R<br />

Members of Direct Access and Sequential Access Bound Libraries<br />

Members of existing direct access bound libraries and sequential access bound<br />

libraries can be identified without a libref using the syntax below:<br />

’(member)’<br />

For example:<br />

data ’user489.test.saslib(member1)’; x=1; run;<br />

proc print data=’user489.test.saslib(member1)’; run;<br />

If the value of the SYSPREF= system option was USER489, the following equivalent<br />

syntax could have been used:<br />

data ’.test.saslib(member1)’; x=1; run;<br />

proc print data=’.test.saslib(member1)’; run;<br />

Although the syntax is similar to the notation used <strong>for</strong> partitioned data set (PDS)<br />

members, a <strong>SAS</strong> data library is not a PDS, and only <strong>SAS</strong> files can be accessed in this<br />

manner.<br />

Members of HFS Libraries<br />

Members of new or existing HFS libraries can be identified without a libref using the<br />

syntax below:<br />

’’/member<br />

If the library directory (that is, the lowest level directory in the specified path) does<br />

not exist, <strong>SAS</strong> will automatically create it if possible.<br />

The directory path can be fully qualified, as in the following example:<br />

data ’/u/user905/MyProject/Member1’; x=51; run;<br />

proc print data=’/u/user905/MyProject/Member1’; run;

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

Saved successfully!

Ooh no, something went wrong!