I have written a stored process that my user/client wants to be able to edit in EG 4.2 (I wrote it using SAS on the server). The stored process generates a landscape PDF report. I have specified _odsDest as a hidden parameter with a value of PDF to create a PDF report. I also added:
before the stpbegin call to create a landscape report. However when the stored process is edited in EG it inserts an extra stpbegin above that code, thus causing the report to be generated as portrait.
How can allow him to edit it in EG, yet preserve the landscape option. I did not see any options/settings in EG that would allow me to do that.
I don't have a current install to test, but someplace on the SP setup screens, there was a way to check whether to include code for the macros -- in EG 4.1, it was 3 little check boxes at the bottom of one step. I'm not sure whether that still exists in EG 4.2. I remember the place that you could check was on the step where the code was showing.
On the second page of the stored process wizard there is a "Include code for" drop down button. From this you can uncheck the "Stored process macros" which will suppress the generation of the %STPBEGIN/%STPEND macros. If you uncheck this you will have to manually insert the %STPBEGIN/%STPEND macros, but you also have full control over where to place them.
Thanks Greg and Cynthia. Worked just as you explained.
I did notice however that EG was issuing a warning that the option to generate stpbegin/stpend was turned off AND they were not inclulded in the code. But they were included in the code. I finally determined that the problem appears to be that EG is looking for the macro calls with a semicolon (. So I was able to change the code so that message is not generated.
Hi, Don...that little extra semicolon in a macro call dates back to SAS/IntrNet days. We used to have to teach students to explicitly put the ';' when they used macro programs in Application Dispatcher code. It was something about how a token needed to be provided -- I've forgotten exactly why that was. But I noticed that it carried over to stored processes. My guess is that's because the stored process server is very like the old Application Dispatcher APPSRV. Just a guess.
The issue is not really IntrNet as I think the problem is a very old one. I actually discovered it (and reported it) back in the early 80s. If a macro can have parameters, and no parameter values are specified (i.e., there are no parens), and the macro call is the last token in the program, the SAS wordscanner issues an error for Unexpected End of File since it is looking for parens.
The correct (IMO) way to handle this is to call the macro as:
instead of putting a semicolon at the end. As long as the stpend macro is not the last token, there is no error.