18.08.2013 Views

(SYSLIB) Programming Reference Manual - Public Support Login ...

(SYSLIB) Programming Reference Manual - Public Support Login ...

(SYSLIB) Programming Reference Manual - Public Support Login ...

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.

Section 10<br />

GETPSF$–Get a Scratch File Routine<br />

The GETPSF$ routine assigns program scratch files.<br />

10.1. File Assignment<br />

For greater efficiency, a common set of file names has been defined for use by system<br />

processors, language processors, and programs that require one or more scratch files.<br />

Based on the abbreviation PSF (program scratch file), these file names are PSF$, PSF1$,<br />

PSF2$...PSF9$.<br />

These files are generally assigned only once per run. The first program that requires a<br />

file calls GETPSF$ to perform the assignment and then leaves it assigned for subsequent<br />

use by other programs in the run. Since GETPSF$ does not initialize or clear the scratch<br />

files, programs must assume that there may be data in the scratch file left over from its<br />

previous use.<br />

Programs may call GETPSF$ to assign up to 10 PSF files. To avoid the extra expense of<br />

assigning scratch files to a run, request file PSF$ if only one file is needed. If two files<br />

are needed, request PSF$ and PSF1$. If this convention is followed, chances are greater<br />

that the file requested has already been assigned to the run. When a call to GETPSF$<br />

requests the assignment of a file that is already assigned to the run, the cost to the<br />

calling program is considerably less than if GETPSF$ actually has to assign a file.<br />

7833 1733–004 10–1

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

Saved successfully!

Ooh no, something went wrong!