PROC FCMP can create
independent and reusable functions, CALL routines, and subroutines
using DATA step syntax that is stored in a data set. The following
example shows how to create and save functions with PROC FCMP. This
example creates a function called ReverseName. The function rearranges
the order of customer names from last name, first name to first name,
last name (for example, Lu, Patrick becomes Patrick Lu).
proc fcmp outlib=orion.functions.dev;
function ReverseName(name $) $40;
return(catx('',scan(name,2,','),scan(name,1,',')));
endsub;
quit;