📄 sqlauto.sas
字号:
/****************************************************************/ /* S A S S A M P L E L I B R A R Y */ /* */ /* NAME: SQLAUTO */ /* TITLE: EXAMPLE LIBNAME STATEMENT FOR PERMANENT DATASETS */ /* PRODUCT: BASE */ /* SYSTEM: ALL */ /* KEYS: SQL SYSCP LIBNAME MACRO %QUOTE */ /* PROCS: SQL */ /* DATA: */ /* */ /* SUPPORT: KMS, PMK UPDATE: */ /* REF: */ /* MISC: */ /* */ /****************************************************************/ title1 '*** sqlauto: Ex. libname statement for perm datasets ***'; /*--------------------------------------------------------------*/ /*-- The technique used is to define a SAS macro that checks --*/ /*-- to see which operating system we are executing on, and --*/ /*-- issues the appropriate libname statement for a permanent --*/ /*-- SAS data library. --*/ /*-- --*/ /*-- You will have to change the physical path names to --*/ /*-- values that are suitable in your environment. --*/ /*-- --*/ /*--------------------------------------------------------------*/%macro sqlstrt; /*---------------------------------------------------------------*/ /*-- APOLLO --*/ /*---------------------------------------------------------------*/ %if %quote(&SYSSCP) = DOMAIN or %quote(&SYSSCP) = bsd4.2 %then %do; libname sql '.'; %end; /*---------------------------------------------------------------*/ /*-- DEVHOST, hp700 development --*/ /*---------------------------------------------------------------*/ %else %if %quote(&SYSSCP) = DEVHOST %then %do; libname sql '.'; %end; /*---------------------------------------------------------------*/ /*-- MVS/TSO --*/ /*---------------------------------------------------------------*/ %else %if %quote(&SYSSCP) = OS %then %do; libname sql '&temp' unit=3380 disp=(new,delete) space=(cyl,(1,1)); %end; /*---------------------------------------------------------------*/ /*-- VM/CMS --*/ /*---------------------------------------------------------------*/ %else %if %quote(&SYSSCP) = CMS %then %do; libname sql 'a'; %end; /*---------------------------------------------------------------*/ /*-- VSE --*/ /*---------------------------------------------------------------*/ %else %if %quote(&SYSSCP) = VSE %then %do; libname sql disp=new; %end; /*---------------------------------------------------------------*/ /*-- VAX/VMS --*/ /*---------------------------------------------------------------*/ %else %if %quote(&SYSSCP) = VMS %then %do; libname sql '[]'; %end; /*---------------------------------------------------------------*/ /*-- OS|2 --*/ /*---------------------------------------------------------------*/ %else %if %quote(&SYSSCP) = OS2 or %quote(&SYSSCP) = WIN %then %do; libname sql '.'; %end; /*---------------------------------------------------------------*/ /*-- DG/AOSVS --*/ /*---------------------------------------------------------------*/ %else %if %quote(&SYSSCP) = AOSVS %then %do; libname sql ":$sysparm:sql:sampsio"; %end; /*---------------------------------------------------------------*/ /*-- ALL UNIXen --*/ /*---------------------------------------------------------------*/ %else %if %quote(&mach) = %quote(NEXT) or %quote(&mach) = %quote(DG UX) or %quote(&mach) = %quote(88K) or %quote(&mach) = %quote(Domain) or %substr(%quote(&mach),1,3) = %quote(SUN) or %quote(&mach) = %quote(ULTRIX) or %quote(&mach) = %quote(UMIPS) or %quote(&mach) = %quote(SINIX) or %quote(&mach) = %quote(IRIX) or %substr(%quote(&mach),1,2) = %quote(HP) or %quote(&mach) = %quote(CONVEX) or %quote(&mach) = %quote(RS6000) or %quote(&mach) = %quote(SR10) or %quote(&mach) = %quote(386 BCS) or %quote(&mach) = %quote(MIPS ABI) %then %do; libname sql '.'; %end; %else %if %quote(&mach) = %quote(AIX_370) or %quote(&mach) = %quote(AIX_ESA) %then %do; libname sql '.'; %end; /*---------------------------------------------------------------*/ /*-- catch-all, for those machine we havent dreamed of yet! --*/ /*---------------------------------------------------------------*/ %else %do; %put *** SQLAUTO.SAS cannot deal with "&SYSSCP".; %put ***; %put *** Please Consult the SAS companion for your; %put *** operating system.; %put ***; %put *** Thank You. (and have a nice day!); %end; %mend; /*----------------------------------------------------------------*/ /*-- execute the macro so that the correct library is defined. --*/ /*----------------------------------------------------------------*/ %sqlstrt;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -