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.

Using <strong>SAS</strong> Data Libraries Assigning <strong>SAS</strong> Data Libraries Externally 57<br />

A partially qualified directory path may also be specified, in which the path specified<br />

is relative to the current working directory. For example, if the current working<br />

directory is /u/user905, the example below would be equivalent to the example above:<br />

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

proc print data=’MyProject/Member1’; run;<br />

It is not necessary to specify the <strong>SAS</strong> file extension to a member if the member type<br />

is implied by the context, and if the default engine is the desired engine. However, if<br />

you wanted to access TAPE engine files that exist in the same directory as BASE<br />

engine files, you would need to specify the extension as shown below:<br />

proc print data=’NewProject/member1.sas7sdat’; run;<br />

Assigning <strong>SAS</strong> Data Libraries Externally<br />

<strong>SAS</strong> data libraries can be assigned externally by first allocating a DDname to the<br />

library via JCL or a TSO command. Assignment of the library is then completed by<br />

specifying the DDname as a libref within <strong>SAS</strong>. At that point, <strong>SAS</strong> selects an engine <strong>for</strong><br />

the library according to the rules detailed in the section “How <strong>SAS</strong> Assigns an Engine”<br />

on page 59. However, if the reference to the libref is in a LIBNAME statement that<br />

explicitly specifies which engine should be used, <strong>SAS</strong> uses the rules described in<br />

“Specifying an Engine <strong>for</strong> Externally Allocated <strong>SAS</strong> Data Libraries” on page 59.<br />

Despite the advantages of assigning <strong>SAS</strong> data libraries internally, assigning <strong>SAS</strong><br />

libraries externally also has advantages, which might be important in some cases.<br />

3 You might not want to allow a <strong>SAS</strong> job running in batch to start until the data<br />

libraries it needs to access are available. If you allocate the data libraries using<br />

DD statements in JCL, the z/<strong>OS</strong> job scheduler will automatically ensure that the<br />

data libraries are accessible:<br />

3 by granting the job exclusive access to the data library if DISP=OLD is<br />

specified<br />

3 by granting the job shared access to the data library if DISP=SHR is specified.<br />

3 The syntax of the JCL DD statement and the TSO ALLOCATE command is more<br />

comprehensive than that of the LIBNAME statement. For example, in order to<br />

specify a list of more than 30 volumes, it is necessary to use external allocation.<br />

3 If a particular <strong>SAS</strong> program uses an externally assigned <strong>SAS</strong> data library, it is<br />

possible to change the library that the program acts upon merely by changing the<br />

JCL or TSO clist that invokes <strong>SAS</strong>, as opposed to changing the program. This may<br />

prove to be convenient in some circumstances.<br />

Note:<br />

3 Because direct bound data libraries are not partitioned data sets (PDS or PDSE),<br />

they cannot be concatenated via external allocation. An attempt to concatenate<br />

library data sets in this way is ignored with a warning, and only the first library<br />

in the concatenation is recognized. However, sequential access bound libraries can<br />

be concatenated if they are allocated with DISP=SHR.<br />

3 <strong>SAS</strong> will not attempt to de-allocate a library data set that was allocated external<br />

to <strong>SAS</strong>. There<strong>for</strong>e, externally assigned bound libraries will remain allocated until<br />

the end of the job step or until a TSO FREE command is issued. However, if<br />

FREE=CL<strong>OS</strong>E is specified on the external allocation <strong>for</strong> a direct access bound<br />

library, the library will be de-allocated by the system when the last libref assigned<br />

to the library is cleared. This exception does not apply to sequential access bound<br />

libraries; they would not be freed at de-assign time even if FREE=CL<strong>OS</strong>E was<br />

specified.

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

Saved successfully!

Ooh no, something went wrong!