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.
| Parameter | Description |
|---|---|
| fmtLibName | Specifies the name of the session format library to be exported to a control table. |
| casOut | Specifies the settings for the output CAS table, including the name, caslib, and replacement options. |
Create a new format library named 'demoFmtLib' and add a simple character format '$gender' to it for demonstration purposes.
| 1 | |
| 2 | PROC CAS; |
| 3 | sessionProp.addFmtLib / fmtLibName="demoFmtLib" replace=true; |
| 4 | sessionProp.addFormat / fmtLibName="demoFmtLib" name="$gender" ranges={" 'M'='Male' ", " 'F'='Female' "}; |
| 5 | |
| 6 | RUN; |
| 7 |
Export the contents of the 'demoFmtLib' format library to an in-memory CAS table named 'fmt_export'.
| 1 | |
| 2 | PROC CAS; |
| 3 | sessionProp.fmtLibCntlOut / fmtLibName="demoFmtLib" casOut={name="fmt_export", replace=true}; |
| 4 | |
| 5 | RUN; |
| 6 |
Export the format library to a specific CAS library (Casuser) and overwrite the table if it already exists.
| 1 | |
| 2 | PROC CAS; |
| 3 | sessionProp.fmtLibCntlOut / fmtLibName="demoFmtLib" casOut={name="fmt_cntl_final", caslib="casuser", replace=true}; |
| 4 | |
| 5 | RUN; |
| 6 |