Dynamically assign fileref to external file
Sometimes, you might want to assign fileref to external file which path you get to know during some complex data manipulations. In that case, filename statement is difficult to use as filepath you need to know in advance. Along with FILENAME statement, SAS offers also FILENAME function, which you can use within the DATA step. SAS Base SAS Data Integration Studio Let's assume that you already have SAS dataset created that contains path to csv file. Then you need to: add "User Written Code" transformation (under "Data->User Written Code"), connect SAS dataset (that contains path to csv file) to "User Written Code transformation". Go to "User Written Code" properties, tab "Code" (keep "Code generation mode: User Written Body"), and in the code body write the following text right above %rcSet(&syserr... (it is sometimes hard to see, but automatically generated code has a greyish background, and ...