Published on :
Général CREATION_INTERNE

Sans titre

This code is also available in: Deutsch Español Français
Data Analysis

Type : CREATION_INTERNE


The script does not use any external data. It only manipulates library references and system paths based on the active SAS session.

1 Code Block
DATA STEP
Explanation :
This `DATA _NULL_` block performs the conditional assignment logic. It uses `DCREATE` to create the physical folder, `LIBNAME` (function) for the assignment, and `LIBREF` to check the success of the operation, with a fallback to the default WORK folder.
Copied!
1DATA _null_;
2 LENGTH rc0 $ 32767 rc1 rc2 8;
3 rc0 = DCREATE("dsSQLtmp", "%sysfunc(pathname(work))/" );
4 rc1 = LIBNAME("dsSQL", "%sysfunc(pathname(work))/dsSQLtmp", "BASE");
5 rc2 = LIBREF ("dsSQL" );
6 IF rc2 NE 0 THEN
7 rc1 = LIBNAME("dsSQL", "%sysfunc(pathname(work))", "BASE");
8RUN;
2 Code Block
LIBNAME
Explanation :
Displays in the log the technical details of the recently assigned `dsSQL` library, allowing verification of whether it points to the subdirectory or the WORK folder.
Copied!
1/* list the details about the library in the log */
2LIBNAME dsSQL LIST;
3 
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.