Functions and CALL Routines under UNIX |
Category: | External Files |
UNIX specifics: | Information items available |
See: | FOPTNAME Function in SAS Language Reference: Dictionary |
Syntax | |
Details | |
Example: File Attributes When Using the Pipe Device Type | |
See Also |
Syntax |
FOPTNAME(file-id, nval) |
specifies the identifier that was assigned when the file was opened, generally by the FOPEN function.
specifies the number of the file information item to be retrieved. The following table shows the values that nval can have in UNIX operating environments for single, pipe, and concatenated files:
Details |
FOPTNAME returns a blank if an error occurs.
Example: File Attributes When Using the Pipe Device Type |
The following example creates a data set that contains the NAME and VALUE attributes returned by the FOPTNAME function when you are using pipes:
data fileatt; length name $ 20 value $ 40; drop fid j infonum; filename mypipe pipe 'UNIX-command'; fid=fopen("mypipe","s"); infonum=foptnum(fid); do j=1 to infonum; name=foptname(fid,j); value=finfo(fid,name); put 'File attribute' name 'has a value of ' value; output; end; run;
The following statement should appear in the SAS log:
File attribute Pipe Command has a value of UNIX-command
UNIX-command is the UNIX command or program where you are piping your output or where you are reading your input. This command or program must be either fully qualified or defined in your PATH environment variable.
See Also |
FOPEN Function in SAS Language Reference: Dictionary
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.