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.

Writing to the Internal Reader<br />

Accessing External Files Using the FILE Statement to Specify Data Set Attributes 89<br />

This example uses the FILENAME and FILE statements to write to an internal<br />

reader:<br />

filename injcl ’.misc.jcl’ disp=shr;<br />

filename outrdr sysout=a pgm=intrdr<br />

recfm=fb lrecl=80;<br />

data _null_;<br />

infile injcl(myjcl);<br />

file outrdr noprint notitles;<br />

input;<br />

put _infile_;<br />

run;<br />

Writing to a Temporary Data Set<br />

The following examples use the FILENAME and FILE statements to write to a<br />

temporary data set.<br />

3 This example shows how to use default attributes to define a temporary file:<br />

filename tempfile ’&mytemp’ ;<br />

data out;<br />

file tempfile;<br />

put ...;<br />

run;<br />

3 The next example defines a temporary file and specifies some of its attributes:<br />

filename nextone ’&mytemp’ disp=new<br />

lrecl=80 blksize=320 space=(trk,(3));<br />

data out;<br />

file nextone;<br />

put ...;<br />

run;<br />

Using the FILE Statement to Specify Data Set Attributes<br />

You can specify data set attributes in the FILE statement as well as in the<br />

FILENAME statement or FILENAME function. <strong>SAS</strong> supplies default values <strong>for</strong> any<br />

attributes that you do not specify. (For in<strong>for</strong>mation about default values, see “Overview<br />

of DCB Attributes” on page 381 and “DCB Option Descriptions” on page 379.)<br />

This example specifies values <strong>for</strong> LRECL= and RECFM= in the FILE statement and<br />

allows <strong>SAS</strong> to use the default value <strong>for</strong> BLKSIZE=:<br />

filename x ’userid.newdata’ disp=new<br />

space=(trk,(5,1)) volume=xyz111;<br />

data out;<br />

file x lrecl=80 recfm=fb;<br />

put ... ;<br />

run;

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

Saved successfully!

Ooh no, something went wrong!