Skip to Main Content
SAS Certified Professional Prep Guide
book

SAS Certified Professional Prep Guide

by SAS Institute
October 2019
Intermediate to advanced content levelIntermediate to advanced
430 pages
19h 4m
English
SAS Institute
Content preview from SAS Certified Professional Prep Guide

Creating Functions with PROC FCMP

A Brief Overview

Within SAS, you can create your own functions. Creating your own functions is useful when you have repetitive routines in your programs. The SAS Function Compiler (FCMP) procedure enables you to create custom functions using DATA step syntax. This feature enables programmers to more easily read, write, and maintain complex code with independent and reusable routines.

PROC FCMP Syntax

Use PROC FCMP to build user-defined functions and call routines with DATA step syntax.
PROC FCMP Syntax
Syntax, PROC FCMP step:
PROC FCMP OUTLIB=libref.table.package;
FUNCTION function-name(arguments)<$> <length>;
. . . programming statements. . .
RETURN(expression);
ENDSUB;
QUIT;
OUTLIB=libref.table.package ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

SAS Certified Specialist Prep Guide

SAS Certified Specialist Prep Guide

SAS Institute
SAS in Practice

SAS in Practice

Ekta Saraogi

Publisher Resources

ISBN: 9781642954692