sessionProp combineFmtLibs

Standard Consolidation of Regional Format Libraries

Scénario de test & Cas d'usage

Business Context

A retail bank operates in two major regions (East and West), each maintaining its own SAS format library for local branch codes. For headquarters reporting, the Data Science team needs to create a single, global format library ('GlobalFmts') that unifies definitions from both regions to ensure consistent reporting across the organization.
About the Set : sessionProp

Configuration of session properties.

Discover all actions of sessionProp
Data Preparation

Create two distinct format libraries in the CAS session: 'RegionEast' and 'RegionWest', each containing specific branch code formats.

Copied!
1PROC FORMAT casfmtlib='RegionEast';
2 value $eastbr 'E01'='New York Main' 'E02'='Boston Hub';
3RUN;
4PROC FORMAT casfmtlib='RegionWest';
5 value $westbr 'W01'='Los Angeles Main' 'W02'='Seattle Hub';
6RUN;

Étapes de réalisation

1
Execute the combination of the two regional libraries into a new global library.
Copied!
1PROC CAS;
2 sessionProp.combineFmtLibs RESULT=r STATUS=rc /
3 fmtLibsIn={"RegionEast", "RegionWest"},
4 fmtLibOut="GlobalFmts";
5 PRINT r;
6RUN;
2
Verify the content of the new global library (optional check using listFmtLibs or similar, implicitly verified if no error).
Copied!
1 
2PROC CAS;
3sessionProp.listFmtLibs fmtLibName="GlobalFmts";
4RUN;
5 

Expected Result


The action completes successfully (rc=0). A new format library named 'GlobalFmts' is available in the session, containing both '$eastbr' and '$westbr' formats. The original libraries remain unchanged.