dev2r-geek

Wednesday, November 30, 2005

A function inside a JSP

This is something that I recently found out the hard way. In JSP, never, ever use global variables using a <%! ... >. When the servlet is generated, the global variables are placed outside the service() method.

Why did I do this in spite of dire warnings? I needed to call a function inside a JSP. The simple solution: Don't. Put the method inside a bean and call it there. MVC, remember!?

Tuesday, November 08, 2005

will code for food


See dev2r.
dev2r needs a job.
dev2r can code.
code dev2r, code.


email iam.dev2r (at) gmail (dot) com if you'd like to see his resume or if you can forward it to someone who has an opening.

Tuesday, November 01, 2005

Calling a macro from a SAS data step

1) The CALL EXECUTE statement inside a data step will delay execution of the macro until runtime.

Although this has its advantages (you can pass a variable from each observation and compute to your heart's content), it has a big disadvantage: A CALL SYMPUT inside the macro doesn't instantaneously create the SYMPUT variable. This makes CALL EXECUTE particularly useless as a function inside a loop (to speak in normal programming terms).

The workaround? Jeff suggests placing the entire data step inside the macro thus avoiding any macro variable passing between data step and macro call. Thus, instead of passing a variable name as a macro parameter, pass the entire dataset name and add a new variable inside to the dataset inside the macro.


 

View My Stats