The FILENAME statement is a global SAS statement that manipulates filerefs. In IMLPlus, it is normally the case that you must place global SAS statements in a SUBMIT block or prefix the statement with the @ character. However, IMLPlus provides limited support for the FILENAME statement as a native IMLPlus statement.
The FILENAME statement has many different forms. IMLPlus only supports the following forms:
IMLPlus also supports an IMLPlus-specific form of the FILENAME statement that accepts an IML expression:
filename fileref (external-file-expression);
The external-file-expression argument must evaluate to a scalar character matrix. IMLPlus processes the FILENAME statement as if it were
filename fileref "evaluated-external-file-expression";
If you need to use a form of the FILENAME statement that is not supported by IMLPlus, you must submit the FILENAME statement to SAS for processing.
filename txtfile "C:\MyData\MyFile.txt";
pathname = "C:\MyData\MyFile.txt"; filename txtfile (pathname);
@filename txtfile clear;
f = "txtfile";
p = "C:\MyData\MyFile.txt";
submit fileref=f pathname=p;
filename &fileref &pathname;
endsubmit;
statement = 'filename txtfile "C:\MyData\MyFile.txt";'; SAS.SubmitStatements( statement );