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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

94 Reading from a Sequential File Chapter 5<br />

are documented in “INFILE Statement” on page 387. You can use these options to<br />

do the following:<br />

3 define variables that will contain in<strong>for</strong>mation about the external file<br />

3 specify special open and close processing<br />

3 specify file characteristics.<br />

INFILE Statement Examples<br />

Table 5.4 Examples of the INFILE Statement<br />

Type of Data Set Example<br />

sequential infile ’library.daily.data’;<br />

member of a PDS or PDSE infile report(feb);<br />

or<br />

infile ’lib.daily.src(rpt1)’;<br />

sequential or member of a<br />

PDS or PDSE*<br />

infile data;<br />

IMS infile psb dli;<br />

in-stream infile datalines;<br />

* The type depends on what the fileref is associated with.<br />

Reading from a Sequential File<br />

This example assigns the fileref RAW to the data set MYID.RAW.DATAX and uses<br />

the fileref in a simple DATA step:<br />

filename raw ’myid.raw.datax’ disp=shr;<br />

data out;<br />

infile raw;<br />

input ... ;<br />

run;<br />

This example is similar to the previous one, except that it specifies a value <strong>for</strong> the<br />

SYSPREF= system option and then uses a partially qualified data set name in the<br />

FILENAME statement:<br />

options syspref=sys2.sas7;<br />

filename raw2 ’.raw.datax’ disp=shr;<br />

data out;<br />

infile raw2;<br />

input ... ;<br />

run;<br />

See “Specifying Physical Files” on page 14 <strong>for</strong> in<strong>for</strong>mation about using SYSPREF=<br />

and partially qualified data set names.<br />

Reading from a Member of a PDS or PDSE<br />

This example specifies the PDS name in the FILENAME statement and then<br />

specifies the member name in parentheses following the fileref in the INFILE statement:

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

Saved successfully!

Ooh no, something went wrong!