The data (the 'dow' format) is created directly within the SAS script via the `VALUE` statement of `PROC FORMAT`. No external data or data from predefined libraries (like SASHELP) is used as a source for format definition.
1 Code Block
CAS Session Management
Explanation : This block initializes a CAS session and assigns all available CASLIBs. It then sets the default active CASLIB to 'public' via the `options caslib=` statement, which influences where subsequently defined formats will be written or searched for.
Explanation : This `PROC FORMAT` procedure defines a user-defined format named 'dow' that associates numeric values (1-7) with the names of the days of the week. The `CASFMTLIB="casformats"` option specifies that this format should be stored in a CAS format library named 'casformats', thus making it available in the CAS environment.
Explanation : This block uses `cas casauto` actions to manage the CAS format library. `savefmtlib` saves the 'dow' format to the 'casformats' library. `promotefmtlib` makes this format library available to all active CAS sessions. Finally, `listfmtranges` displays the details of the 'dow' format to verify its existence and configuration in CAS.
Copied!
cas casauto savefmtlib fmtlibname=casformats table=dow replace;
cas casauto promotefmtlib fmtlibname='casformats' replace;
cas casauto listfmtranges fmtname=dow;
1
cas casauto savefmtlib fmtlibname=casformats TABLE=dow replace;
2
3
cas casauto promotefmtlib fmtlibname='casformats' replace;
4
5
cas casauto listfmtranges fmtname=dow;
4 Code Block
PROC CAS (Administration)
Explanation : This `PROC CAS` block is used for administrative tasks. It first assumes a `SuperUser` role to allow modifications to CAS server options. Then, it uses the `configuration.setServOpt` action to modify the `fmtsearch` option, adding 'casformats' to the format search path, which is crucial for applications like SAS Visual Analytics to find and use formats defined in CAS. Finally, `configuration.getServOpt` is used to verify that the option has been updated.
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.