![]() This podcast will explore various areas of the financial services industry, career paths in finance, and other practical insights that will help students better understand and prepare for professional success in the field of finance. Creating a SAS Server Page which is a user-interface to the letter generation process - allowing the user to select which letter to generate.Welcome to Careers in Finance, presented by the Boehly Center for Excellence in Finance at William & Mary’s Raymond A. ![]() That is, the format that creates the $gender format and the code to create the macro variables will be part of the input SAS Server Page. Embedding SAS code to be executed into a SAS Server Page.My next two blogs will take a different path by building on this example to illustrate: I then show how to create an RTF document (that can be viewed and edited by word processing softtware like Microsoft Word). In Chapter 4 I build upon this example by next using the macro facility to generate a letter for each observation in the data set. The macro variables created in the DATA Step are simply referenced and thus resolved by PROC STREAM.The desired text is intermixed with the needed HTML tags (e.g., P, BR, UL, LI, B, etc.).The %SYSFUNC Macro is used with the DATE function to insert the current date using the worddate format.Just a few notes about this HTML file (which I refer to as a SAS Server Page due to the use of the Macro Language to customize it): At year end, &name will be asked to produceĪ chart of their growth over the school year. Year old &sex's height and weight and recording Then PROC STREAM is called and the input SAS Server Page which is the desired HTML letter is defined using %INCLUDE.Īnd, here is the input SAS Server Page that PROC STREAM processes:Īware of a project we are doing this year.Įvery month we will be collecting your &age.The VVALUE function is used so the values of the macro variables are the formatted values. Note that the SYMPUTX function is used as it handles numeric to character conversion. A DATA Step is used to subset the desired observations and load all the variables into like-name macro variables as well as to assign formats to both the Age and Sex variables.A format is created to map F/M to daughter/son so that the generated letter looks a little nicer.The code is pretty simple at a conceptual level: &streamDelim %include srvrpgs(class.html) * associate the desired formats with sex and age */ Set sashelp.class(firstobs=&letterObs obs=&letterObs) ![]() * read one observation and create macro variables. The code is being run by my runMacro facility that runs the following macro. Feel free to try different observation numbers by editing the URL.Īssuming you've clicked on the links to try these out, lets talk about how this works. The value of the parameter letterObs is checked to make sure it is an integer as discussed in my last post, Simple Utility Macros and SAS Server Pages. ![]() But you can supply an observation number as follows: If no observation number is specified, the default is to generate a letter for observation 1. Using the SAS/IntrNet Application Dispatcher:.That way you can see the results using these links: It has been slightly modified so it can be run over the web. This example is based on the example from Section 4.1 of SAS® Server Pages: Generating Dynamic Content (and Chapter 4 is included in the soon to be released free preview copy). This post is going to be about a real-world use case: a mail-merge example where the requirement is to generate custom content for each defined subset of data-usually each observation. So far all of my postings about PROC STREAM and SAS Server Pages have been setting up some of the basics.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |