|
Macros for SAS Application Developers
https://github.com/sasjs/core |
Creates a file in the logical filesystem of the target platform. More...
Go to the source code of this file.
When building applications that run on multiple flavours of SAS, it is convenient to use a single macro (like this one) to write a text file - eg a settings file - without worrying about the platform primitive.
The file is created in the logical filesystem of the target platform (SAS Content folder, SASjs Drive, or metadata folder). No file is created on a physical filesystem. Platform behaviour:
The alternative would be to compile a generic macro in target-specific folders (SASVIYA, SAS9 and SASJS). This avoids compiling unnecessary macros at the expense of a more complex sasjsconfig.json setup.
Usage:
filename ft15f001 temp; data _null_; file ft15f001; put '%let mysetting=42;'; run; %* viya: /Public/app/myapp/settings (Files Service) ; %* sasjs: /Public/app/myapp/settings.sas (SASjs Drive) ; %* sas9: /User Folders/sasdemo/myapp/settings (metadata) ; %let filepath=/Public/app/myapp/settings; %mx_createfile(&filepath, inref=ft15f001)
| [in] | filepath | The full path of the file to create, INCLUDING the filename (must contain at least one / delimiter). On SASjs Server the name should carry the .sas extension if it will be executed as a Stored Program. |
| [in] | inref= | (0) The fileref containing the file content. A valid fileref is mandatory - if omitted, the macro aborts with an error. |
| [in] | mdebug= | (0) Set to 1 to enable DEBUG messages |
Definition in file mx_createfile.sas.