亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sqljmac.sas

?? SAS是功能強大的統計軟體
?? SAS
字號:
 /****************************************************************/ /*          S A S   S A M P L E   L I B R A R Y                 */ /*                                                              */ /*    NAME: SQLJMAC                                             */ /*   TITLE: improves SQL join performance with macros           */ /* PRODUCT: BASE                                                */ /*  SYSTEM: ALL                                                 */ /*    KEYS: SQL DATMAN MACRO %UPCASE %SCAN %EVAL SELECT WHERE   */ /*          ALIAS                                               */ /*   PROCS: SQL                                                 */ /*    DATA:                                                     */ /*                                                              */ /* SUPPORT: pmk                         UPDATE:                 */ /*     REF:                                                     */ /*    MISC:                                                     */ /*                                                              */ /****************************************************************/ title1 'SAS SAMPLE LIBRARY, MEMBER(SQLJMAC)'; /*  *  * Users have noticed that joining a small SAS dataset with a Large  * DBMS table using PROC SQL can take a very long time, even if the  * "joining variables" are indexed in the DBMS.  *  * The reson for this is that DBMS Software does not make the  * indexes visible to applications software thru the SQL interface,  * so the PROC SQL query optimiser has no choice but to make a  * complete pass over all the DBMS rows to see if they match with  * the rows in the smaller SAS dataset. (This problem does not  * arise when the larger dataset is a SAS dataset with indexes  * as SAS is able to perform direct access operations on only  * those rows that it needs from the larger table)  *  * This performace gap can be remedied by constructing a where  * clause that requests only the needed rows from the larger file.  * PROC SQL will send any parts of a where clause that relate  * to a single table only off to the engine that is responsible  * for that table -- this gives the DBMS a chance to put the index  * to work.  *  * If the number of unique keys is small relative to the size  * of the DBMS table, this approach may give you very good  * performance gains.  *  * This technique of calculating the keys required for one  * side of the join, and then restricting the rows retrieved  * from the other side is a relatively new optimisation made  * by DBMS Software. (DB2 2.3 is the first db2 release that  * implements this scheme). A future Version of PROC SQL may  * perform this kind of optimisation transparently.  *  *  * If the number of unique keys in the small dataset gets large  * it may prove inefficient to create macro variables for all the  * values. The datastep in the prejoin macro could be modified  * to write the needed where clause to a temporary file..  * The drawback to this approach is that the other parts of the  * query must be written out to temporary files too, and then  * all the parts included together like this:  *  *      %inc(pre where post);  *  *  * If you know something about the range of keys in the smaller  * file, it may be more efficient to construct a BETWEEN x AND y  * to restrict the rows accessed from the larger table. This  * generates a smaller where clause and requires fewer macro variables,  * but is not as general in its application... it would be useful if  * (for example) you knew that the smaller dataset contained dates  * from just one month in a history file.  *  */ /*  *  * The prejoin macro constructs the list of unique key values  * that are needed to build a where clause to apply to the  * larger dataset. The pfx argument allows you to choose the  * "root" of the macro names created by the macro...  *  * Assuming the default prefix "TJ"  *  * TJKN            is the number of key variables.  * TJNN            is the number of unique ocurrences of the key.  * TJK1  .. TJKn   are the key variable names in the smaller table.  * TJT1  .. TJTn   are the datatypes of those key variables.  * TJ1X1 .. TJnXm  are the values of the keys.  *  */%macro prejoin( ds=         /*-- the smaller dataset name        --*/              , key=        /*-- the names of the join variables --*/              , keytype=    /*-- the types of the keys (C or N)  --*/              , pfx=TJ      /*-- work datasets and macros prefix --*/              );  /*---------------------------------------------------------------*/  /*-- load up the individual keynames into their own macro      --*/  /*-- variables.                                                --*/  /*---------------------------------------------------------------*/  %local i j var;  %let i    = 1;  %let var  = %scan(&key, &i);  %do %while ( &var ne );     %global &pfx.K&i;     %let    &pfx.K&i = &var;     %global &pfx.T&i;     %let    &pfx.T&i = %upcase(%scan(&keytype, &i));     %let    i        = %eval(&i+1);     %let    var      = %scan(&key, &i);     %end;  %global &pfx.KN &pfx.NN;  %let    &pfx.KN = %eval(&i - 1);  /*---------------------------------------------------------------*/  /*-- create a table with the unique values of the key from     --*/  /*-- the smaller dataset. these values will be used to build   --*/  /*-- a where clause to apply to the larger dataset.            --*/  /*---------------------------------------------------------------*/  proc sql;    create table work.&pfx as    select distinct           %do i = 1 %to &&&pfx.KN;              %if (&i > 1) %then %str(,);              &&&pfx.K&i              %end;      from &ds;  %global &pfx.NN;  %let    &pfx.NN = &sqlobs;  %put NOTE: There are &sqlobs unique keys in the smaller table.;    quit;  %do i = 1 %to &&&pfx.NN;      %do j = 1 %to &&&pfx.KN;          %global &pfx.&j.X&i;          %end;      %end;  /*---------------------------------------------------------------*/  /*-- place these unique values into macro variables, so that   --*/  /*-- we can use them later to build a where clause to apply to --*/  /*-- the larger table.                                         --*/  /*--                                                           --*/  /*-- the quote() function is new with sas6.07, and takes care  --*/  /*-- of the messy details of character strings with embedded   --*/  /*-- quotes.. If you know your keys dont have quotes, then     --*/  /*-- you could omit the quote() call.                          --*/  /*---------------------------------------------------------------*/  data _null_;    set work.&pfx;    length cn $6 mvar $8;    cn = 'X' || left(put(_n_, 5.));    %do i = 1 %to &&&pfx.KN;       mvar = "&pfx.&i" || cn;       * put mvar= &&&pfx.K&i=;       %if ( N = &&&pfx.T&i ) %then %do;          call symput( mvar, put(&&&pfx.K&i, best12.) );          %end;       %else %do;          call symput( mvar, quote(&&&pfx.K&i) );        * call symput( mvar,       &&&pfx.K&i  );  /* if no quotes */          %end;       %end;    run;%mend; /*  *  * The keyjoin macro constructs the where clause from the  * values saved away by the prejoin macro.  *  */%macro keyjoin( alias=      /*-- the alias of the big dataset    --*/              , key=        /*-- the names of the join variables --*/              , pfx=TJ      /*-- work datasets and macros prefix --*/              );  %local i j;  /*---------------------------------------------------------------*/  /*-- if they supply a key value, then the "names" of the keys  --*/  /*-- are not the same in the BIG dataset. so remember these    --*/  /*-- new key names.  (They better be in the same order with    --*/  /*-- repect to the order of the names given to prejoin.)       --*/  /*---------------------------------------------------------------*/  %if ( %str(X&key) ne X ) %then %do;     %let i    = 1;     %let var  = %scan(&key, &i);     %do %while ( &var ne );        %local  &pfx.K&i;        %let    &pfx.K&i = &var;        %let    i        = %eval(&i+1);        %let    var      = %scan(&key, &i);        %end;     %end;  /*---------------------------------------------------------------*/  /*-- go emit the key variables and their values that were      --*/  /*-- found in the "smaller" dataset.                           --*/  /*---------------------------------------------------------------*/(  %do i = 1 %to &&&pfx.NN;      %if (&i > 1) %then %str(OR); (      %do j = 1 %to &&&pfx.KN;          %if (&j > 1) %then %str(AND); &alias..&&&pfx.K&j = &&&pfx.&j.X&i          %end; )      %end;)  %mend;  /*---------------------------------------------------------------*/  /*-- lets make some data to play with.                         --*/  /*--                                                           --*/  /*-- doing this exercise when joining SAS datasets helps,      --*/  /*--   as it sometimes makes the size of the data we must      --*/  /*--   sort smaller.  but in 607 we often do joins without     --*/  /*--   any sorting, so you should test it out on YOUR data.    --*/  /*--                                                           --*/  /*--                                                           --*/  /*-- doing this exercise when joining SAS datasets with        --*/  /*--   datasets that come form an external source via          --*/  /*--   SAS/ACCESS software helps, as we dont have to           --*/  /*--   transfer as many records for the DBMS into SAS to       --*/  /*--   begin with, let alone sort them all..                   --*/  /*--                                                           --*/  /*---------------------------------------------------------------*/data big;  length k $20;  do i = 1 to 100;    do j = 1 to 5;      k = trim(put(i, words13.)) || '*' || put(j, words6.);      output;      end;    end;  run;data small;  length kk $20;  do i = 7 to 270 by 4;     j  = 3;     kk = trim(put(i, words13.)) || '*' || put(j, words6.);     output;     end;  run;  /*---------------------------------------------------------------*/  /*-- this example joins the variables on one numeric key -- I  --*/  /*--                                                           --*/  /*-- the %prejoin step computes the unique key values of I     --*/  /*--     in the "small" dataset.                               --*/  /*--                                                           --*/  /*-- then the %keyjoin macro emits a where expression that     --*/  /*--     selects only those values computed by %prejoin        --*/  /*--     from the big table.                                   --*/  /*--                                                           --*/  /*---------------------------------------------------------------*/%prejoin(ds=small, key=i, keytype=n);proc sql feedback;  select *    from big,small   where big.i=small.i     and big.j=2     and %keyjoin(alias=big);  /*---------------------------------------------------------------*/  /*-- this example joins the variables on two keys -- I and J   --*/  /*---------------------------------------------------------------*/%prejoin(ds=small, key=i j, keytype=n n);proc sql feedback;  select *    from big,small   where big.i=small.i and big.j=small.j     and %keyjoin(alias=big)       ;  /*---------------------------------------------------------------*/  /*-- join on one character key                                 --*/  /*-- just to make it interesting, its called K in one dataset  --*/  /*-- (the bigger one) and "KK" in the smaller one.             --*/  /*---------------------------------------------------------------*/%prejoin(ds=small, key=kk, keytype=c);proc sql feedback;  select *    from big,small   where big.k=small.kk     and %keyjoin(alias=big,key=k)       ;quit;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
粉嫩欧美一区二区三区高清影视| 久久这里只精品最新地址| 自拍偷拍欧美精品| proumb性欧美在线观看| 自拍偷拍欧美精品| 欧美日韩免费观看一区三区| 亚洲图片一区二区| 欧美一区午夜视频在线观看| 久久国产三级精品| 欧美国产禁国产网站cc| 久久精品夜色噜噜亚洲aⅴ| 亚洲成人综合视频| 日韩一级大片在线| 国产精品99久| 亚洲欧美国产高清| 欧美日韩另类一区| 久久国产精品一区二区| 国产精品久久久久久亚洲伦| 欧美性生活一区| 久久激情五月婷婷| 国产精品不卡一区| 欧美猛男gaygay网站| 国产综合久久久久影院| 亚洲女厕所小便bbb| 欧美一区二区三区在| 高清日韩电视剧大全免费| 一区二区三区鲁丝不卡| 精品国产麻豆免费人成网站| av激情亚洲男人天堂| 日韩主播视频在线| 国产精品久久久久久久久晋中| 欧美日韩国产综合草草| 国产精品资源在线看| 亚洲宅男天堂在线观看无病毒| 精品久久久久久久久久久久包黑料| 成人一区二区视频| 青青草伊人久久| 亚洲情趣在线观看| 久久人人超碰精品| 欧美日韩精品久久久| 成人精品视频一区| 美日韩一区二区| 一区二区三区在线观看视频| 久久蜜桃香蕉精品一区二区三区| 亚洲成a人片在线不卡一二三区| 色婷婷精品久久二区二区蜜臀av| 日本少妇一区二区| 亚洲天堂成人在线观看| 精品美女被调教视频大全网站| 色一情一伦一子一伦一区| 国产乱色国产精品免费视频| 亚洲成a人v欧美综合天堂 | 国产精品久久三区| 欧美一区二区成人| 在线精品视频免费播放| 成人精品一区二区三区四区| 精品一区二区三区在线播放视频 | 日韩精品一区二区在线| 91国模大尺度私拍在线视频| 成人蜜臀av电影| 国产一区二区三区免费在线观看| 日韩电影免费在线观看网站| 亚洲午夜免费电影| 亚洲欧美韩国综合色| 亚洲欧洲精品一区二区三区| 国产日韩亚洲欧美综合| 久久女同性恋中文字幕| 精品国产sm最大网站| 欧美一区二区三区喷汁尤物| 欧美日韩一区二区欧美激情 | 欧美视频中文字幕| 91麻豆文化传媒在线观看| 国产aⅴ综合色| 国产成人精品午夜视频免费| 久久99热狠狠色一区二区| 日韩一区二区在线观看视频| av色综合久久天堂av综合| 成人久久18免费网站麻豆| 成人精品免费视频| 成人国产精品免费| 99这里都是精品| av在线一区二区| 色94色欧美sute亚洲线路一ni| 色av一区二区| 在线电影欧美成精品| 日韩一级片网站| 久久综合久久综合久久| 欧美国产亚洲另类动漫| 综合激情网...| 亚洲永久免费av| 天天操天天综合网| 美女看a上一区| 国产一区久久久| 99视频一区二区| 一本一道综合狠狠老| 欧美日韩精品专区| 精品日韩成人av| 国产精品乱码人人做人人爱| 亚洲精品国产第一综合99久久| 亚洲国产日韩a在线播放性色| 人人超碰91尤物精品国产| 国产一区二区电影| 91一区在线观看| 91精品国产综合久久小美女| 欧美精品一区二区三区在线| 国产精品毛片大码女人| 亚洲午夜久久久| 国产裸体歌舞团一区二区| 91亚洲国产成人精品一区二区三| 93久久精品日日躁夜夜躁欧美| 欧美区一区二区三区| 欧美高清视频一二三区| 制服.丝袜.亚洲.另类.中文| 久久久亚洲欧洲日产国码αv| 中文字幕一区二区三区四区不卡| 亚洲高清在线视频| 国产一区二区久久| 欧洲av一区二区嗯嗯嗯啊| 精品国产乱码久久| 亚洲精品国久久99热| www国产成人免费观看视频 深夜成人网| 欧美性生交片4| 久久久久久久久岛国免费| 亚洲一二三四在线观看| 国产一区不卡在线| 欧美日韩中文一区| 国产精品久久久久影院老司| 日韩成人一级大片| 91啪亚洲精品| 久久久亚洲精华液精华液精华液| 一区二区三区高清| 国产精品123| 日韩一区二区免费视频| 亚洲色图19p| 国产伦精品一区二区三区视频青涩| 色狠狠色狠狠综合| 中文字幕第一页久久| 另类小说综合欧美亚洲| 精品视频全国免费看| 亚洲欧洲日韩女同| 风间由美中文字幕在线看视频国产欧美| 欧美日本高清视频在线观看| 国产精品伦理一区二区| 热久久一区二区| 欧美日韩国产一级片| 亚洲三级免费电影| 岛国精品在线播放| 久久久亚洲欧洲日产国码αv| 日韩av电影天堂| 精品视频一区 二区 三区| 亚洲美女免费在线| av成人免费在线观看| 日本一区二区三区dvd视频在线| 国产专区综合网| 精品av久久707| 久久精品国产77777蜜臀| 777午夜精品视频在线播放| 亚洲成人综合在线| 欧美综合天天夜夜久久| 亚洲男人的天堂在线aⅴ视频| 成人av电影在线观看| 欧美国产激情一区二区三区蜜月 | 在线欧美日韩精品| 久久久久久久精| 国产一区二区精品久久91| 亚洲精品一区二区三区影院| 毛片av中文字幕一区二区| 日韩一区二区三区免费看| 午夜精品久久久久影视| 欧美日韩国产成人在线91| 午夜久久久久久久久| 欧美片在线播放| 亚洲gay无套男同| 欧美日韩高清不卡| 日韩电影在线观看一区| 欧美一区二区精品| 久久99精品国产麻豆不卡| 精品免费视频一区二区| 久久国产欧美日韩精品| 久久久精品2019中文字幕之3| 国产999精品久久久久久绿帽| 日本一区二区免费在线| 成人爱爱电影网址| 一区二区三区**美女毛片| 欧美丰满少妇xxxxx高潮对白| 麻豆精品久久久| 欧美国产成人精品| 在线一区二区三区做爰视频网站| 亚洲成人自拍一区| 精品欧美乱码久久久久久1区2区 | 亚洲国产精品影院| 7777精品伊人久久久大香线蕉经典版下载 | 国产一级精品在线| 国产精品国产三级国产普通话蜜臀| 91美女片黄在线观看| 亚洲成a人v欧美综合天堂下载| 国产一区二区中文字幕| 日韩你懂的在线播放| 国产成人欧美日韩在线电影| 亚洲欧洲精品一区二区三区 |