Chapter Contents

Previous

Next
PATHNAME

PATHNAME



Returns the physical name of a SAS data library or of an external file, or returns a blank

Category: SAS File I/O
Category: External Files


Syntax
Arguments
Details
Examples
See Also

Syntax

PATHNAME(fileref | libref)

Arguments

fileref
specifies the fileref assigned to an external file.

libref
specifies the libref assigned to a SAS library.


Details

PATHNAME returns the physical name of an external file or SAS library, or blank if fileref or libref is invalid. The default length of the target variable in the DATA step is 200 characters.

A fileref can be assigned to an external file by using the FILENAME statement or the FILENAME function.

Operating Environment Information:   Under some operating environments, filerefs can also be assigned by using system commands. For details, see the SAS documentation for your operating environment.  [cautionend]

You can assign a libref to a SAS library using the LIBNAME statement or the LIBNAME function. Some operating environments allow you to assign a libref using system commands.


Examples

This example uses the FILEREF function to verify that the fileref MYFILE is associated with an external file. Then it uses PATHNAME to retrieve the actual name of the external file:

data _null_;
  length fname $ 100;
  rc=fileref("myfile");
  if (rc=0) then
  do;
    fname=pathname("myfile");
    put fname=;
  end;
run;

See Also

Functions:

FEXIST
FILEEXIST
FILENAME
FILEREF

Statements:

LIBNAME
FILENAME


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.