mirror of
https://github.com/yabwon/SAS_PACKAGES.git
synced 2026-01-05 06:10:05 +00:00
version 2.1
recompiled with new framework setup
This commit is contained in:
42
packages/SQLinDS/002_function/dssql.sas
Normal file
42
packages/SQLinDS/002_function/dssql.sas
Normal file
@@ -0,0 +1,42 @@
|
||||
/*** HELP START ***/
|
||||
|
||||
/* >>> dsSQL() function: <<<
|
||||
*
|
||||
* Internal function called by %SQL() macro.
|
||||
* The function pass query code from the %SQL()
|
||||
* macro to the %dsSQL_Inner() innternal macreo.
|
||||
*
|
||||
* Recommended for SAS 9.3 and higher.
|
||||
* Based on paper:
|
||||
* "Use the Full Power of SAS in Your Function-Style Macros"
|
||||
* by Mike Rhoads, Westat, Rockville, MD
|
||||
* https://support.sas.com/resources/papers/proceedings12/004-2012.pdf
|
||||
*
|
||||
**/
|
||||
|
||||
/*** HELP END ***/
|
||||
|
||||
proc fcmp
|
||||
/*inlib = work.&packageName.fcmp*/
|
||||
outlib = work.&packageName.fcmp.package
|
||||
;
|
||||
function dsSQL(unique_index_2, query $) $ 41;
|
||||
length
|
||||
query query_arg $ 32000 /* max query length */
|
||||
viewname $ 41
|
||||
;
|
||||
query_arg = dequote(query);
|
||||
rc = run_macro('dsSQL_Inner' /* <-- inner macro */
|
||||
,unique_index_2
|
||||
,query_arg
|
||||
,viewname
|
||||
);
|
||||
if rc = 0 then return(trim(viewname));
|
||||
else
|
||||
do;
|
||||
put 'ERROR:[function dsSQL] A problem with the dsSQL() function';
|
||||
return(" ");
|
||||
end;
|
||||
endsub;
|
||||
run;
|
||||
quit;
|
||||
Reference in New Issue
Block a user