sessionProp

fmtLibCntlIn

Description

The fmtLibCntlIn action creates a format library from a control table. This is useful for importing format definitions stored in a CAS table, similar to the CNTLIN= option in the PROC FORMAT procedure. The input table must adhere to the structure required for format control data sets (containing variables like FMTNAME, START, LABEL, etc.).

Settings
ParameterDescription
fmtLibNameSpecifies the name of the format library to be created in the current session.
tableSpecifies the settings for the input table containing the format control data. This includes the table name, caslib, and optional filtering (WHERE clause) or computed variables.
Data Preparation View data prep sheet
Create Control Data

Create a CAS table named 'formats_data' with format definitions for a traffic light color scheme.

Copied!
1 
2DATA casuser.formats_data;
3LENGTH fmtname $32 start $16 label $32;
4fmtname='$traffic';
5start='R';
6label='Red';
7OUTPUT;
8fmtname='$traffic';
9start='Y';
10label='Yellow';
11OUTPUT;
12fmtname='$traffic';
13start='G';
14label='Green';
15OUTPUT;
16 
17RUN;
18 

Examples

Create a format library named 'TrafficFmt' from the 'formats_data' control table.

SAS® / CAS Code Code awaiting community validation
Copied!
1 
2PROC CAS;
3sessionProp.fmtLibCntlIn / fmtLibName="TrafficFmt" TABLE={name="formats_data", caslib="casuser"};
4 
5RUN;
6 
Result :
A new format library named 'TrafficFmt' is created in the session, containing the $traffic format.

Create a format library named 'RedOnly' by applying a filter to the input table to only include the 'Red' definition.

SAS® / CAS Code Code awaiting community validation
Copied!
1 
2PROC CAS;
3sessionProp.fmtLibCntlIn / fmtLibName="RedOnly" TABLE={name="formats_data", caslib="casuser", where="start='R'"};
4 
5RUN;
6 
Result :
The 'RedOnly' library is created containing only the definition for the Red signal.

FAQ

What is the primary function of the fmtLibCntlIn action?
Are there any specific restrictions associated with this action?
Which parameters are mandatory for the fmtLibCntlIn action?
What options are available for configuring the input table?