The macro does not consume external or internal SAS data (like SASHELP) as a source for its main processing. Its purpose is to create or modify a text file on the file system to influence the behavior of the SASjs server. The source of the header data (name and value) is provided via the macro parameters.
1 Code Block
MACRO mfs_httpheader Data
Explanation : This code block defines the `%mfs_httpheader` macro. It declares global and local variables necessary for file management. The macro begins by attempting to assign a fileref (`fref`) to the file path specified by the global variable `sasjs_stpsrv_header_loc`. If this operation fails, it returns an error. Then, it opens this file in append mode (`A`) to add content without overwriting existing content. If the open operation fails, an error is also reported. The macro then writes the `header_name: header_value` pair to the file, ensuring that special characters are handled correctly (`%str`). After writing, the file is closed and the fileref is released. These operations use the `%sysfunc` functions with SAS file input/output functions (`filename`, `fopen`, `fput`, `fwrite`, `fclose`).
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.