sessionProp

fmtLibCntlOut

Description

The fmtLibCntlOut action creates a SAS Cloud Analytic Services (CAS) table that contains the definitions of formats from a specified format library. This output table follows the structure of a standard SAS CNTLOUT data set, allowing users to back up formats, transfer them between sessions, or programmatically inspect format ranges and labels.

Settings
ParameterDescription
fmtLibNameSpecifies the name of the session format library to be exported to a control table.
casOutSpecifies the settings for the output CAS table, including the name, caslib, and replacement options.
Data Preparation View data prep sheet
Create Data for Example

Create a new format library named 'demoFmtLib' and add a simple character format '$gender' to it for demonstration purposes.

Copied!
1 
2PROC CAS;
3sessionProp.addFmtLib / fmtLibName="demoFmtLib" replace=true;
4sessionProp.addFormat / fmtLibName="demoFmtLib" name="$gender" ranges={" 'M'='Male' ", " 'F'='Female' "};
5 
6RUN;
7 

Examples

Export the contents of the 'demoFmtLib' format library to an in-memory CAS table named 'fmt_export'.

SAS® / CAS Code Code awaiting community validation
Copied!
1 
2PROC CAS;
3sessionProp.fmtLibCntlOut / fmtLibName="demoFmtLib" casOut={name="fmt_export", replace=true};
4 
5RUN;
6 
Result :
A CAS table named 'fmt_export' is created containing the definition rows (start, end, label) for the $gender format.

Export the format library to a specific CAS library (Casuser) and overwrite the table if it already exists.

SAS® / CAS Code Code awaiting community validation
Copied!
1 
2PROC CAS;
3sessionProp.fmtLibCntlOut / fmtLibName="demoFmtLib" casOut={name="fmt_cntl_final", caslib="casuser", replace=true};
4 
5RUN;
6 
Result :
The table 'fmt_cntl_final' is created in the 'Casuser' library, containing the format definitions from 'demoFmtLib'.

FAQ

What is the primary purpose of the fmtLibCntlOut action in SAS Viya?
Which action set contains the fmtLibCntlOut action?
What are the required parameters for the fmtLibCntlOut action?
What information does the 'casOut' parameter provide in the context of fmtLibCntlOut?
Does the fmtLibCntlOut action support saving formats to a CNTL table?