About PROC FCMP

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;

Get SAS Certification Prep Guide, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.